Hi all,

I'm having an issue figuring out how to make an HTTP request without having
the http client automatically attempt redirecting.

I'm doing this because I'm working with a REST API that uses HTTP redirects
(302) to point to various resources, and I'd like to grab the 302 response,
process it, and extract the URL for later processing (but not follow it).

Here's my code as it stands,
currently: http://pastie.org/private/bolqvhxghxkpwngwgbc4a

I can't help but feel that there is a better way to do this. Treating an
HTTP redirect like an error seems... weird. I don't want to do that.

I saw another post on this group from a while back
(https://groups.google.com/forum/#!topic/golang-nuts/PmYm3h2J3FE) which
talks about this -- but I couldn't figure out how to make the suggested
solution work.

Could anyone give me an example of what I need to do to make the HTTP
client *not* attempt to follow redirects?

Thank you!

You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupgolang-nuts @
postedApr 26, '14 at 2:35a
activeApr 26, '14 at 9:15p

3 users in discussion

R: 1 post Naitik Shah: 1 post Martin Angers: 1 post



site design / logo © 2022 Grokbase