nst / STHTTPRequest

Obj-C / Cocoa HTTP requests for humans
BSD 3-Clause "New" or "Revised" License
826 stars 75 forks source link

Obtaining redirect URL with STHTTPRequest #28

Closed MKxDev closed 9 years ago

MKxDev commented 9 years ago

Hey,

I've been using this library for a few months and it hasn't failed me. However, I've come across a scenario where I'm having a problem determining the URL that my request was redirected to. I'm trying to do the implicit flow for OAuth 2.0 and when requesting a URL that should redirect my elsewhere, I am unable to figure out what the new URL is. In addition, I don't even know if the redirect was performed successfully in the first place. By the time completionBlock fires, the response code 200. Any ideas?

nst commented 9 years ago

Before digging further, have you tried the preventRedirections property?

MKxDev commented 9 years ago

When I checked it, it was set to 'NO' as, I believe, it should be.

nst commented 9 years ago

Then, is there a public server where I can reproduce the issue?

If so, could you please send me a sample request?

You can also send it privately if needed: nicolas at seriot dot ch

Also, please specify the behaviour you expect from STHTTPRequest.

Thank you.

MKxDev commented 9 years ago

Hey,

I ended up using a UIWebView for this task. I suspect it has something to do with the way oAuth works in general. Thanks anyway.