February 25, 2009
Parsing HTTP Responses
Just so I don’t have to remember again, in order to seperate a header from the body of a http response, in C:<pre name="code" class="Bash">char* endOfHeader = strstr(buf, “\n\r\n”);</pre>Notice the \r, that is a carriage return, something that Linux/unix doesn’t care much about, but is used more in Windows. I couldn’t find any websites to help with this.
Just so I don't have to remember again, in order to seperate a header from the body of a http response, in C:
Notice the \r, that is a carriage return, something that Linux/unix doesn't care much about, but is used more in Windows. I couldn't find any websites to help with this.
char* endOfHeader = strstr(buf, "\n\r\n");
Notice the \r, that is a carriage return, something that Linux/unix doesn't care much about, but is used more in Windows. I couldn't find any websites to help with this.