title: How to parse HTTP responses in C?
body: <p>I'm writing a little project which interacts with a set of servers using HTTP 1.1 GET and POST. The server gives me the response after some header lines, so I though on using <code>strtok()</code> function using <code>\n</code> as the delimiter but there is a crash whenever I try to do so.</p>
  
  <p>Is there any simple way to parse a HTTP response in C? I would like not to use 3rd party libraries for this but if it was really necesary I won't have any problem.</p>
  
  <p>Thank you very much for everything.</p>
  
  <p>EDIT: Here is some example code, just trying to print the lines:</p>
  
  <pre><code>char *response = "HTTP/1.1 200 OK\nServer: Apache-Coyote/1.1\nPragma: no-cache"
  
  char *token = NULL;
  token = strtok(response, "\n");
  while (token) {
      printf("Current token: %s.\n", token);
      token = strtok(NULL, "\n");
  }
  </code></pre>