Hi everyone. I'm trying to code a Wikipedia bot using libcurl. After a request, the following is in my 'header' buffer. Now, I want to parse this for errors, which is not easy because I'm trying to use C99 and <string.h>
1. Is it normal to get 3 or more than 1 header in reply?
2. If I do, should I simply strstr the lot of them for all the common MediaWiki API errors? Can I assume that if there's an error, it will be in the last one?
Code:HTTP/1.0 200 OK Date: Sun, 06 Mar 2011 07:54:39 GMT Server: Apache Cache-Control: private Vary: Accept-Encoding Content-Length: 513 Content-Type: text/xml; charset=utf-8 X-Cache: MISS from sq33.wikimedia.org X-Cache-Lookup: MISS from sq33.wikimedia.org:3128 X-Cache: MISS from sq63.wikimedia.org X-Cache-Lookup: MISS from sq63.wikimedia.org:80 Connection: close HTTP/1.0 200 OK Date: Sun, 06 Mar 2011 07:54:40 GMT Server: Apache Cache-Control: public, s-maxage=0, max-age=2678400 Last-Modified: Sun, 06 Mar 2011 07:51:25 GMT Vary: Accept-Encoding Content-Length: 386 Content-Type: text/x-wiki; charset=UTF-8 X-Cache: MISS from sq63.wikimedia.org X-Cache-Lookup: MISS from sq63.wikimedia.org:3128 X-Cache: MISS from sq71.wikimedia.org X-Cache-Lookup: MISS from sq71.wikimedia.org:80 Connection: close HTTP/1.0 200 OK Date: Sun, 06 Mar 2011 07:54:41 GMT Server: Apache Cache-Control: private Vary: Accept-Encoding Content-Length: 933 Content-Type: text/html; charset=utf-8 X-Cache: MISS from sq34.wikimedia.org X-Cache-Lookup: MISS from sq34.wikimedia.org:3128 X-Cache: MISS from sq65.wikimedia.org X-Cache-Lookup: MISS from sq65.wikimedia.org:80 Connection: close



LinkBack URL
About LinkBacks


