Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants