![]() |
|
#1
|
|||
|
|||
HTTP post program generates 302 moved errorI'm working on a simple program to post to a web site and display the response on the screen. The problem is that I keep getting a "302 moved temporarily" error. Whatever file I ask for, I get the same error.
A few lines below the error message is a line that says "Location:" and then the URL that I am trying to post to. That URL is the same as the one I used in the post command. Yet if I open a browser and stick that URL in it, the page comes up ok - this really confuses me. The code is as follows: CPP / C++ / C Code:
It looks like this when I run it: Quote:
I'd really appreciate it if someone could tell me how to interpret the error message, and maybe even how to fix the program. BTW, this is my first post to this forum, so apologies to all if my etiquette is not ok. Thanks. -HB |
|||
|
#2
|
|||
|
|||
Re: HTTP post program generates 302 moved errorThe crucial line in my post above is not showing up correctly.
It should be: Quote:
|
|
#3
|
|||
|
|||
Third tryThe line still does not appear as it should. It keeps getting truncated. One more try:
After "Location: www.abebooks.com" the following should be on the same line: /servlet/SearchResults?isbn=0380718774 |
|
#4
|
|||
|
|||
Re: HTTP post program generates 302 moved errorThanks for replying.
Yes, I tried 'Get'. It worked fine. This is a modified version of that program. I don't understand what you mean by 'set up for'. Is my request formatted improperly? |
|
#5
|
|||
|
|||
Re: HTTP post program generates 302 moved errorQuote:
I'm sorry that I posted too quickly and deleted it (but, obviously not quickly enough). The sequence that you posted works with some web servers but not others. I share your confusion, since the server is supposed to send the redirected address, but obviously didn't in this case. (Since sending the "POST" request to that URI gave this message in the first place.) Using "GET" instead of "POST" works to retrieve the searched-for information (and "GET" is appropriate for read-only, fixed information), but there's no reason that they shouldn't have implemented "POST" properly (or not at all). Sorry about the confusion with my post and even more sorry that I don't have any insight into anything you could do differently for this web site. Maybe someone else has some ideas and/or workarounds. Regards, Dave |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| error template with C linkage | MichaelS-R | C++ Forum | 6 | 17-May-2006 11:09 |
| Winsock error when compiling FLTK 2.0 Projects | mauriciorossi | FLTK Forum | 3 | 16-Aug-2005 10:18 |
| Help with syntax errors | PeteGallo | C Programming Language | 7 | 08-Aug-2005 20:30 |
| What is "Ambigious symbol" ??*( a compilation error) | small_ticket | C++ Forum | 2 | 07-Jan-2005 21:10 |
| Can enum have same name as class? | crystalattice | C++ Forum | 3 | 08-Dec-2004 16:43 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The