Fork of wolfSSL's HTTPClient fork. Fork!
Dependents: exosite_http_example exosite_http_example
Fork of HTTPClient by
Diff: HTTPClient.cpp
- Revision:
- 33:bdd333d3939c
- Parent:
- 30:a9ecee69c6b5
- Child:
- 34:a34fcee9f204
diff -r a9ecee69c6b5 -r bdd333d3939c HTTPClient.cpp --- a/HTTPClient.cpp Fri Dec 05 07:03:47 2014 +0000 +++ b/HTTPClient.cpp Tue Jan 20 14:13:54 2015 -0600 @@ -168,9 +168,10 @@ return m_httpResponseCode; } -void HTTPClient::setHeader(const char * h) +void HTTPClient::setHeader(int idx, char * h) { - header = h ; + if (idx < MAX_HEADER_COUNT) + header[idx] = h; } void HTTPClient::setLocationBuf(char * url, int size) @@ -360,8 +361,8 @@ } //Add user headers - if(header) { - ret = send((char *)header); + for(int i = 0; i < MAX_HEADER_COUNT && header[i] != 0; i++) { + ret = send(header[i]); CHECK_CONN_ERR(ret); }