Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alamofire 5: Incorrect documentation instructions for default HTTP headers #3266

Closed
1 task done
hardev opened this issue Jul 28, 2020 · 1 comment · Fixed by #3292
Closed
1 task done

Alamofire 5: Incorrect documentation instructions for default HTTP headers #3266

hardev opened this issue Jul 28, 2020 · 1 comment · Fixed by #3292
Assignees

Comments

@hardev
Copy link

hardev commented Jul 28, 2020

The documentation has this paragraph which talks about a non existing property of URLSessionConfiguration

If you need to customize these headers, a custom URLSessionConfiguration should be created,
the defaultHTTPHeaders property updated, and the configuration applied to a new Session instance.
Use URLSessionConfiguration.af.default to customize your configuration while keeping Alamofire's default headers.

What did you do?

let configuration = URLSessionConfiguration.af.default
configuration.defaultHTTPHeaders

What did you expect to happen?

I expected the defaultHTTPHeaders property to be present in the configuration

What happened instead?

Got an Xcode error saying Value of type 'URLSessionConfiguration' has no member 'defaultHTTPHeaders'

Alamofire Environment

Alamofire version: 5.2.2
Xcode version: 11.6
Swift version: 5.3
Platform(s) running Alamofire: iOS
macOS version running Xcode: Mac OS X 10.15.5

Demo Project

N/A

@jshier
Copy link
Contributor

jshier commented Jul 28, 2020

Feel free to file a PR to correct the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants