This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3100BOOST: Unable to retrieve message body for a GET method on MSP430F5529LP/CC3100 (Http_Client example)

I have being working on developing a IOT project using MSP430F5529LP and CC3100. Currently is I am unable to retrieve the response body from a message response to GET method request. I have executed the same GET Method command using CURL and I get a complete response include both the Header and Body. Below is the curl command.

curl -k -v "https://www.example.com/dir1/dir2/dir3/userLogin?name=xxxxx&password=yyyyyy&appId=zzz"

Below is excerpt from the response

* STATE: INIT => CONNECT handle 0x6000572f0; line 1103 (connection #-5000)

* TLSv1.2 (OUT), TLS header, Certificate Status (22):


> User-Agent: curl/7.47.0
> Accept: */*

* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Content-Type: application/xml;charset=UTF-8
< Transfer-Encoding: chunked
< Vary: Accept-Encoding
< Date: Sat, 09 Sep 2017 12:33:41 GMT
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< Cache-Control: private, max-age=0, no-cache, no-store
<
* STATE: PERFORM => DONE handle 0x6000572f0; line 1645 (connection #0)
* Curl_done
* Connection #0 to host www.example.com left intact

<ns1:userLoginResponse xmlns:ns1="http://example.com/dir3/">userId>xxxxx</userId><securityToken>yyyyyy-zzzzzzz</securityToken></ns1:userLoginResponse>

Following information can be retrieved. `Server, Content-Type, Transfer-Encoding: chunked, Vary, Date, Strict-Transport-Security and Cache-Control` but I am unable to retrieve `<ns1:userLoginResponse xmlns:ns1="http://example.com/dir3/">userId>xxxxx</userId><securityToken>yyyyyy-zzzzzzz</securityToken></ns1:userLoginResponse>`

I have modified http_client example I believe the issue is related to GET method not returning a "Content-Length"

I believe in the following code the variable `len` is looking for a value greater than 0.

bytesRead = HTTPCli_readResponseBody(httpClient, (char *)dataBuffer, len, &moreFlags);

The variable `len` is set by the following code

case 0: /* HTTPCli_FIELD_NAME_CONTENT_LENGTH */
{
len = strtoul((char *)g_buff, NULL, 0);
}

Since `"Content-Length"` is not present in the GET method response header the value remains the initial value of 0.

I am hope someone has encountered a similar scenario if so can you please share some ideas how this issue can be resolved.

Reference: