4 ms·
Well he's just spelling out the steps to explain HTTP Digest. In the real world, any HTTP client library worth using already implements HTTP authentication tra
by Andys 17y ago
Well he's just spelling out the steps to explain HTTP Digest.
In the real world, any HTTP client library worth using already implements HTTP authentication transparently to you, the API consumer.
- jasonkester 17y agoThat's actually surprising, that the default behavior for a HttpWebRequest.GetResponse() method would be to parse the response and decide to send off a second request automatically. I would expect some developer involvement would be required. Regardless, assuming I'm using your library, I'd still need to do a request, some XML parsing to discover the right url, followed by a second request, just to get back the response I want. Compared to 1 request, that's still 3 times the effort for no added benefit.
- DougBTX 17y agoIt's an interesting artefact of the libraries we use that digest authentication is difficult, but you can "just use" SSL.
- psadauskas 17y agoThey make digest easy, too: curl --anyayth --user admin:sekret http://exmaple.com/resource_protected_by_digest_auth
- kragen 17y agoMost libraries I've used have the option to respond to 401s automatically, and a lot of them have HTML parsing, too. There are some added benefits. The load-balancing example he gives in the article is one; a second one is that there's less stuff to get wrong in the client code, generally. Instead of working from some informal equivalent of WSDL, you're writing code that interrogates the service at run-time to find the current definition of the interface.
- jamie_ca 17y agoIf more people did proper restful applications, perhaps there would also be proper libraries for interacting with them? Perhaps something that looks like this (with a ruby flavor): RestfulApi.new('http://api.twiddla.com/ http://api.twiddla.com/, :user => 'billy', :password => 'ILikeRainbows').post('Meetings')
- psadauskas 17y agoYes, exactly. I've written a (rough) DataMapper adapter for interfacing with them. class User include DataMapper::Resource resource_name "AllUsers" # define some properties end User.first(:login => "admin") http://github.com/absperf/dm-ssbe-adapter/tree http://github.com/absperf/dm-ssbe-adapter/tree