WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: JTaylor on April 06, 2016, 07:14:36 AM

Title: iHttpHeaders returns ERROR after iHttpOpen returns a 200 response
Post by: JTaylor on April 06, 2016, 07:14:36 AM
Any ideas on why iHttpHeaders would return ERROR after iHttpOpen returns a 200 response?   

Thanks.

Jim
Title: Re: iHttpHeaders returns ERROR after iHttpOpen returns a 200 response
Post by: td on April 06, 2016, 07:46:32 AM
The usual practice for determining the cause of a WinInet extender error is to  use  iGetLastError() to get the system error.
Title: Re: iHttpHeaders returns ERROR after iHttpOpen returns a 200 response
Post by: JTaylor on April 06, 2016, 07:57:10 AM
That shows as 122 but it isn't in the wininet error list.  Is there another list I should check?

Jim
Title: Re: iHttpHeaders returns ERROR after iHttpOpen returns a 200 response
Post by: td on April 06, 2016, 11:09:20 AM
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.
Title: Re: iHttpHeaders returns ERROR after iHttpOpen returns a 200 response
Post by: JTaylor on April 06, 2016, 11:20:45 AM
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
Title: Re: iHttpHeaders returns ERROR after iHttpOpen returns a 200 response
Post by: td on April 06, 2016, 11:45:51 AM
Sure.
Title: Re: iHttpHeaders returns ERROR after iHttpOpen returns a 200 response
Post by: td on April 07, 2016, 08:33:58 AM
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.
Title: Re: iHttpHeaders returns ERROR after iHttpOpen returns a 200 response
Post by: 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
Title: Re: iHttpHeaders returns ERROR after iHttpOpen returns a 200 response
Post by: td on April 07, 2016, 10:40:32 AM
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.