AbstractBeliefs

Untitled

Apr 28th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main ()
  5. {
  6.   char *str ="HTTP/1.0 200 OK\n"
  7.               "Date: Thu, 26 Apr 2012 20:57:31 GMT\n"
  8.               "Server: Apache/2.2.16 (Debian)\n"
  9.               "X-Powered-By: PHP/5.3.3-7+squeeze4ex1\n"
  10.               "Vary: Accept-Encoding\n"
  11.               "Content-Length: 88\n"
  12.               "Connection: close\n"
  13.               "Content-Type: text/html\n"
  14.               "\n"
  15.               "success\n";
  16.  
  17.   // 1. search for success:
  18.   char *content = strstr(<stuff goes here>);
  19.   // 2. Check for success vs fail
  20.   if (content != NULL){
  21.     // Content is now a string pointer with your content
  22.   }
  23.   else {
  24.     // was a failure. :(
  25.   }
  26.   return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment