fabriciocolombo / delphi-rest-client-api

A Delphi REST client API to consume REST services written in any programming language.
Apache License 2.0
380 stars 182 forks source link

Add Basic-Auth support #28

Closed vonloxley closed 9 years ago

vonloxley commented 10 years ago

Add setCredentials-method to HttpConnection-interface and implement it. Fix ConfigureTimeout-implementations not returning self as well.

RobertoSchneiders commented 9 years ago

We are using basic auth like this:

 FRestClient.Resource(URI)
      .Accept(RestUtils.MediaType_Json)
      .Header('Authorization', 'Basic  bW9QjcOL2M05123Q...')
      .Get<TClients>;

I'm not convinced this implementation is necessary, but I cannot think in any objections right now. I will appreciate some other opinions.

I merged some PRs, so, your changes are conflicting, can you fix it?

fabriciocolombo commented 9 years ago

I made some changes from the original approach. The WinHttp and WinInet implementations don't work on Windows 7. They dont include the authorization header. So i implemented in RestClient unit using @RobertoSchneiders approach.

Thansks @vonloxley

RobertoSchneiders commented 9 years ago

:+1: