Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Tarık Taha UYGUN
@ttuygun
Hi!
Are there anybody here?
Rahul Katariya
@RahulKatariya
Hey
Jupiter Jones
@JupiterJones
Is there anyone lurking here? :smiley:
I had a question about Authenticable. Since there isn't an example I was looking at the docs...
extension HTTPBinAuthenticable { var configuration: Configuration { var authentication = Authentication() authentication.credential = URLCredential(user: user, password: password, persistence: .forSession) return authentication } }
which doesn't compile or look quite right. I'm learning Swift with this project so I apologise if this is a silly question.
Jupiter Jones
@JupiterJones
doesn't that code say it's returning a Configuration (being in the configuration get) however it returns an authentication.
I tried using the global configuration and setting an authentication.credential however no credentials (authorisation header) is passed.
I also noticed in the GitHub example, that Credential is bypassed altogether and the authorisation header is set directly.
What is the recommended way to set the authorisation header for all subsequent requests?
Thanks in advance :smiley:
Rahul Katariya
@RahulKatariya
There is an option of directly modify the headers from default configuration and if you want to see that example running, you can run the tests with logging on. In logs you will see the curl it creates. I hope it helps.
Rahul Katariya
@RahulKatariya
@JupiterJones ^
Jupiter Jones
@JupiterJones
Hi @RahulKatariya Thanks for the reply. I have it working by setting the headers directly (like in the GitHub login example. I was just wondering if this is the recommended way, and why setting the defaultConfiguration.authentication.credential doesn’t appear to send the header.
I assume I’m doing something wrong :smiley:
Should the code above correct? I’m still learning Swift and it didn’t look quite right. I’ll keep looking.
Moi Gutierrez
@moyoteg
I cannot get Restofire to integrate in my project with Carthage: no such module found
Moi Gutierrez
@moyoteg
found out that if I changed my dependency to github "Restofire/Restofire"
it would work
Rahul Katariya
@RahulKatariya
@moyoteg 👍🏻
I guess the the logging is not generating the curl output right now but you can do it either way @JupiterJones
Rahul Katariya
@RahulKatariya
Restofire 3.0 🎉. Added Download, Upload and Decodable support