Skip to content

Commit 5d896d2

Browse files
committed
Add header with content encoding
1 parent c92661c commit 5d896d2

File tree

1 file changed

+1
-0
lines changed
  • Documentation.app/Contents/MacOS/Consuming generated code.playground/Pages/Customizing the configuration.xcplaygroundpage

1 file changed

+1
-0
lines changed

Documentation.app/Contents/MacOS/Consuming generated code.playground/Pages/Customizing the configuration.xcplaygroundpage/Contents.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ let baseConfig = API.Config(basePath: "https://url-to-my-server.com")
6565
*/
6666
let configWithHeaders1 = baseConfig.appending(headers: ["Accept": "application/json"])
6767
let configWithHeaders2 = baseConfig.appendingHeader(value: "application/json", forKey: "Accept")
68+
let configWithHeaders3 = baseConfig.appending(contentType: .json)
6869
/*:
6970
Besides this, all methods in our specification that require a header parameter will add an extension method to `API.Config`, where, if we provide a value, it will add it to the headers with the right key. For instance, if our methods require an authentication token, we may have a method like:
7071
*/

0 commit comments

Comments
 (0)