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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom headers? #23

Closed
raulriera opened this issue Nov 12, 2015 · 7 comments
Closed

Custom headers? #23

raulriera opened this issue Nov 12, 2015 · 7 comments

Comments

@raulriera
Copy link

Hey 馃槵
I can see through the code that indeed the library support custom headers, anywhere you can point me in the docs for it? Can't seem to find anything

@dduan
Copy link
Owner

dduan commented Nov 12, 2015

like this?

Just.get("http://httpbin.org/get", headers:["Content-Type": "Swift is Sweet"])

@raulriera
Copy link
Author

Yeah hehe, found it after I wrote it... anywhere to set this as defaults? Trying to pass around the Authorisation Bearer into all the requests.

@raulriera
Copy link
Author

Mostly trying to replicate this, where I funnel all the requests into a single thing that adds anything I need

if let oAuthToken = token {
     request.addValue("Bearer \(oAuthToken.code)", forHTTPHeaderField: "Authorization")
}

NSURLSession.sharedSession().dataTaskWithRequest(request) { (data, response, error) in

Closing as this is only a question

@dduan
Copy link
Owner

dduan commented Nov 12, 2015

@raulriera I made a new release to address this 0.4.3

馃榾

@raulriera
Copy link
Author

That is awesome! thanks 馃拑

@raulriera
Copy link
Author

Hey, quick follow up... after the new release I am unable to use it with carthage

*** Checking out AuthenticationViewController at "1.1.0"
*** Checking out Decodable at "v0.3.3"
*** Checking out Locksmith at "2.0.3"
*** Downloading Just at ""

For some reason the tag shows as "", have you seen this before?

@raulriera
Copy link
Author

Bah, I am full of fails lately hehe... upgrading carthage and git worked

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

No branches or pull requests

2 participants