From: kay <ka...@gm...> - 2010-07-12 10:44:50
|
Yes, but it is hard to have a general HTTP structure, since there are so many fields in HTTP protocol I think it is a good idea to divide the HTTP header and the HTTP content 在 2010年7月12日 下午6:32,Siddhesh Poyarekar <sid...@gm...>写道: > 2010/7/12 Siddhesh Poyarekar <sid...@gm...>: > > (Do a reply-all so that the response goes to the mailing list as well) > > > > 2010/7/12 kay <ka...@gm...>: > >> Thanks for your suggestion, it works now =) > >> I cannot check the HTTP status, whether the captcha is correct or wrong, > the > >> HTTP status is always 301 > >> I find the "The document has moved" is to goto the content of the HTTP > >> message in order to find if what is sent is right or the URL of a new > image. > > > > If it is just to find the captcha url then you can simply get away by > > looking for "a href" and then parsing the link within that tag. But if > > you want to be sure that you received the expected response from the > > server (HTTP 301 instead of, say, 404 or 500) then you ought to be > > looking for the response code and not the string. > > > > Ohh, and it would be a pretty neat idea to have something of an http > response struct passed back to the calling function, which will give > details about the http headers. Right now we simply hack through the > headers and choose what we want. > > > -- > Siddhesh Poyarekar > http://siddhesh.in > -- --Kay |