iHttpHeaders returns ERROR after iHttpOpen returns a 200 response

Started by JTaylor, April 06, 2016, 07:14:36 AM

Previous topic - Next topic

JTaylor

Any ideas on why iHttpHeaders would return ERROR after iHttpOpen returns a 200 response?   

Thanks.

Jim

td

The usual practice for determining the cause of a WinInet extender error is to  use  iGetLastError() to get the system error.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

That shows as 122 but it isn't in the wininet error list.  Is there another list I should check?

Jim

td

Yes, you need to check Windows system errors.  System error 122 = "The data area passed to a system call is too small."  Which means you need "Plan 9 from Outer Space" with respect to using the iHttpHeaders function because, for reasons that are completely beyond me,  the extenders buffer size is hard coded.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Okay.   Guess I will just assume that if it returns a 200 on the Open then the URL is valid.   I know that there are other Response messages sometimes in the Header but not sure it is worth the trouble adding another layer to the verification process, as there are too many already.   Maybe you can pass on a request to fix the buffer size?

Thanks.

Jim

td

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

Keep in mind that the problem is with iHttpHeaders function and not the iHttpOpen function.  Your URL is just fine but the iHttpHeaders function does not have enough buffer space to return all the header information.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Understood.  The Headers are important though because while the IHttpOpen may return a 200 response the Headers tell you whether it resolved to the specified URL or a different one.

In any event, it seems that the iHttpHeaders function should be fixed it if can't handle the data it is supposed to return.

Jim

td

Quote from: JTaylor on April 07, 2016, 08:56:33 AM
Understood.  The Headers are important though because while the IHttpOpen may return a 200 response the Headers tell you whether it resolved to the specified URL or a different one.

In any event, it seems that the iHttpHeaders function should be fixed it if can't handle the data it is supposed to return.

Jim

??
No one said that the headers weren't important.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade