@@ -94,7 +94,7 @@ class HttpClient : public Client
94
94
*/
95
95
int post (const char * aURLPath, const char * aContentType, const char * aBody);
96
96
int post (const String& aURLPath, const String& aContentType, const String& aBody);
97
- int post (const char * aURLPath, const char * aContentType, int aContentLength, const byte aBody[]);
97
+ int post (const char * aURLPath, const char * aContentType, long aContentLength, const byte aBody[]);
98
98
99
99
/* * Connect to the server and start to send a PUT request.
100
100
@param aURLPath Url to request
@@ -112,7 +112,7 @@ class HttpClient : public Client
112
112
*/
113
113
int put (const char * aURLPath, const char * aContentType, const char * aBody);
114
114
int put (const String& aURLPath, const String& aContentType, const String& aBody);
115
- int put (const char * aURLPath, const char * aContentType, int aContentLength, const byte aBody[]);
115
+ int put (const char * aURLPath, const char * aContentType, long aContentLength, const byte aBody[]);
116
116
117
117
/* * Connect to the server and start to send a PATCH request.
118
118
@param aURLPath Url to request
@@ -130,7 +130,7 @@ class HttpClient : public Client
130
130
*/
131
131
int patch (const char * aURLPath, const char * aContentType, const char * aBody);
132
132
int patch (const String& aURLPath, const String& aContentType, const String& aBody);
133
- int patch (const char * aURLPath, const char * aContentType, int aContentLength, const byte aBody[]);
133
+ int patch (const char * aURLPath, const char * aContentType, long aContentLength, const byte aBody[]);
134
134
135
135
/* * Connect to the server and start to send a DELETE request.
136
136
@param aURLPath Url to request
@@ -148,7 +148,7 @@ class HttpClient : public Client
148
148
*/
149
149
int del (const char * aURLPath, const char * aContentType, const char * aBody);
150
150
int del (const String& aURLPath, const String& aContentType, const String& aBody);
151
- int del (const char * aURLPath, const char * aContentType, int aContentLength, const byte aBody[]);
151
+ int del (const char * aURLPath, const char * aContentType, long aContentLength, const byte aBody[]);
152
152
153
153
/* * Connect to the server and start to send the request.
154
154
If a body is provided, the entire request (including headers and body) will be sent
@@ -162,13 +162,13 @@ class HttpClient : public Client
162
162
int startRequest (const char * aURLPath,
163
163
const char * aHttpMethod,
164
164
const char * aContentType = NULL ,
165
- int aContentLength = -1 ,
165
+ long aContentLength = -1 ,
166
166
const byte aBody[] = NULL );
167
167
168
168
/* * Send an additional header line. This can only be called in between the
169
- calls to beginRequest and endRequest .
169
+ calls to startRequest and finishRequest .
170
170
@param aHeader Header line to send, in its entirety (but without the
171
- trailing CRLF. E.g. "Authorization: Basic YQDDCAIGES"
171
+ trailing CRLF. E.g. "Authorization: Basic YQDDCAIGES"
172
172
*/
173
173
void sendHeader (const char * aHeader);
174
174
@@ -272,7 +272,7 @@ class HttpClient : public Client
272
272
@return Length of the body, in bytes, or kNoContentLengthHeader if no
273
273
Content-Length header was returned by the server
274
274
*/
275
- int contentLength ();
275
+ long contentLength ();
276
276
277
277
/* * Returns if the response body is chunked
278
278
@return true if response body is chunked, false otherwise
@@ -307,7 +307,7 @@ class HttpClient : public Client
307
307
virtual int read ();
308
308
virtual int read (uint8_t *buf, size_t size);
309
309
virtual int peek () { return iClient->peek (); };
310
- virtual void flush () { iClient->flush (); };
310
+ virtual void flush () { return iClient->flush (); };
311
311
312
312
// Inherited from Client
313
313
virtual int connect (IPAddress ip, uint16_t port) { return iClient->connect (ip, port); };
@@ -372,9 +372,9 @@ class HttpClient : public Client
372
372
// Stores the status code for the response, once known
373
373
int iStatusCode;
374
374
// Stores the value of the Content-Length header, if present
375
- int iContentLength;
375
+ long iContentLength;
376
376
// How many bytes of the response body have been read by the user
377
- int iBodyLengthConsumed;
377
+ long iBodyLengthConsumed;
378
378
// How far through a Content-Length header prefix we are
379
379
const char * iContentLengthPtr;
380
380
// How far through a Transfer-Encoding chunked header we are
0 commit comments