Permalink
Browse files

docs: add `Default Content-Type values` section (#1284)

  • Loading branch information...
shockey committed Apr 13, 2018
1 parent 98c9a1c commit a5bf44d402b0002bc038fe9a1d45ea67bbeb20b9
Showing with 14 additions and 0 deletions.
  1. +14 −0 docs/MIGRATION_2_X.md
View
@@ -136,3 +136,17 @@ https://github.com/swagger-api/swagger-ui/issues/2793
> NOTE: Cookie authentication is not implemented.
#### Default Content-Type values
Swagger-Client no longer assumes you want `Content-Type: application/json` if you don't provide any `consumes` values. If you want to preserve that behavior, you'll need to implement it yourself with a `requestInterceptor`:
```js
Swagger({
url: "http://petstore.swagger.io/v2/swagger.json",
requestInterceptor: req => {
if(req.body && !req.headers["Content-Type"]) {
req.headers["Content-Type"] = "application/json"
}
}
})
```

0 comments on commit a5bf44d

Please sign in to comment.