
Untitled
By:
AbstractBeliefs on
Apr 28th, 2012 | syntax:
C++ | size: 0.70 KB | hits: 14 | expires: Never
#include <stdio.h>
#include <string.h>
int main ()
{
char *str ="HTTP/1.0 200 OK\n"
"Date: Thu, 26 Apr 2012 20:57:31 GMT\n"
"Server: Apache/2.2.16 (Debian)\n"
"X-Powered-By: PHP/5.3.3-7+squeeze4ex1\n"
"Vary: Accept-Encoding\n"
"Content-Length: 88\n"
"Connection: close\n"
"Content-Type: text/html\n"
"\n"
"success\n";
// 1. search for success:
char *content = strstr(<stuff goes here>);
// 2. Check for success vs fail
if (content != NULL){
// Content is now a string pointer with your content
}
else {
// was a failure. :(
}
return 0;
}