Archived Forum Post

Index of archived forum posts

Question:

Response is chunked

Jan 30 '15 at 10:42

Using VFP to access a URL using basic authentication. This returns StatusCode 200

When I look through the LastErrorText, all looks well, until I get to the body, which just has "Response is chunked" in place of the body I was expecting

Does anybody know why ?

Cheers

**Edit: Sorry, could you clarify for me how with Chilkat I could read the data returned by the provider? In the case where it is Chunked ..?

Thanks in advance **


Answer

The LastErrorText would only contain the first portion of the HTTP response body (up to a certain number of bytes, perhaps 1024), when verbose logging is turned on. If the HTTP response was chunked, then the data will not be in the LastErrorText. (There may also be other cases, such as gzipped responses perhaps.) For more information about chunked HTTP responses, see this: http://en.wikipedia.org/wiki/Chunked_transfer_encoding


Answer

Sorry, could you clarify for me how with Chilkat I could read the data returned by the provider? In the case where it is Chunked ..?

Thanks in advance


Answer

The LastErrorText is not the place where you would get the data returned from an HTTP request.

In addition, the underlying complexities of how the data arrives from HTTP server is not something of concern to a client application. A client application using Chilkat would access the response body via the HttpResponse object (if an HttpResponse object is returned), or by the string or bytes returned directly by the method call.

An HTTP server can send responses in very complex ways -- they can be chunked, base64 encoded, compressed, etc. All of the underlying details of un-chunking, decompressing, decoding, etc. are things the application does not have to be concerned about. The point of using an HTTP API is to not have to be involved with the details and complexities of the guts of the HTTP protocol.