![]() |
|
#1
|
|||
|
|||
Saving http responses in a filehi! I am having some trouble saving the http get response in a file.
I am using telnet for http get requests. since this is in dos, i want to save the http response in a file. I am at a loss on how to implement this in c language. do you know of any function or commands in c that i can use to store the response to a file? I plan to use http get to get the file from a server so that i will have my own copy of the file. I am able to receive successful responses from my http requests but I am at a lost on what command to use to save the response in a file. worst of all, is this really possible using c language? thanks for your help! |
|||
|
#2
|
|||
|
|||
Re: saving http responses in a fileQuote:
Is it really DOS??? Or is it from a command-line window in something like Windows XP? If you are using the Microsoft Telnet client, you can try the following (here's a session from my Windows XP box): Invoke telnet to log on to the remote computer. Code:
Now: Hit ctrl-] to get the telnet prompt and use the "set logfile" telnet command. Here's what I see: Code:
When you end the telnet session, the log file whose name you used in the "set logfile" command will have the stuff that went to your "DOS" window during the telnet session. (Obviously, you can use any legal file name that you want in the "set logfile" command.) If you ever use Linux (or cygwin/GNU telnet client on Windows), use the "script" command before you start the telnet session. The GNU telnet client doesn't have (or need) the "set logfile" telnet command, since system utilities can take care of it. If you are using some third-party telnet client (not Microsoft's) on a Windows (or DOS) platform, maybe it has a mechanism similar to the "set logfile" that I showed. Check the documentation for your program. Maybe it even has a help file. Quote:
Well, you could write your own telnet client, or you could try various implementation-dependent inter-process communications techniques (pipes or some such thing), but I would start by trying to use the features of the given telnet client program and/or operating system. Regards, Dave |
|
#3
|
|||
|
|||
Re: Saving http responses in a filethanks dave! finally! i was able to save the response to a file.
however, the http request and headers are included in the file. I only want to save the contents of the request and eliminate the headers. Is there an easy way to do this? Is there a command that I can use directly or should i make a parser inorder to get the contents? |
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 |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| After execution - Error cannot locate /Skin File? | WSCH | C++ Forum | 1 | 05-Mar-2005 21:03 |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 11:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
| CD Buring Failed | skanth2000 | Computer Hardware Forum | 1 | 15-Nov-2003 04:52 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The