Skip to content

Commit a9c2e99

Browse files
committed
feat(client): include Content-Type header in all requests
1 parent 7d3f029 commit a9c2e99

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib/client.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ class Client {
77
const client = new Client();
88

99

10-
export { client }
10+
export { client };
1111

1212
export function connect(config: CreateAxiosDefaults) {
13-
client.client = axios.create(config);
13+
client.client = axios.create({
14+
...config,
15+
headers: {
16+
...config.headers,
17+
"Content-Type": "application/vnd.api+json",
18+
},
19+
});
1420
}
1521

1622
export default Client

0 commit comments

Comments
 (0)