Skip to content

Commit db0f233

Browse files
author
Sefa Ilkimen
committed
update README (missing url property in callback signature)
1 parent 2263950 commit db0f233

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,15 @@ cordova.plugin.http.sendRequest('https://google.com/', options, function(respons
228228
Execute a POST request. Takes a URL, data, and headers.
229229

230230
#### success
231-
The success function receives a response object with 3 properties: status, data, and headers. **status** is the HTTP response code as numeric value. **data** is the response from the server as a string. **headers** is an object with the headers. The keys of the returned object are the header names and the values are the respective header values. All header names are lowercase.
231+
The success function receives a response object with 4 properties: status, data, url, and headers. **status** is the HTTP response code as numeric value. **data** is the response from the server as a string. **url** is the final URL obtained after any redirects as a string. **headers** is an object with the headers. The keys of the returned object are the header names and the values are the respective header values. All header names are lowercase.
232232

233233
Here's a quick example:
234234

235235
```js
236236
{
237237
status: 200,
238238
data: '{"id": 12, "message": "test"}',
239+
url: 'http://example.net/rest'
239240
headers: {
240241
'content-length': '247'
241242
}
@@ -268,14 +269,15 @@ cordova.plugin.http.post('https://google.com/', {
268269
```
269270

270271
#### failure
271-
The error function receives a response object with 3 properties: status, error and headers. **status** is the HTTP response code as numeric value. **error** is the error response from the server as a string. **headers** is an object with the headers. The keys of the returned object are the header names and the values are the respective header values. All header names are lowercase.
272+
The error function receives a response object with 4 properties: status, error, url, and headers (url and headers being optional). **status** is the HTTP response code as numeric value. **error** is the error response from the server as a string. **url** is the final URL obtained after any redirects as a string. **headers** is an object with the headers. The keys of the returned object are the header names and the values are the respective header values. All header names are lowercase.
272273

273274
Here's a quick example:
274275

275276
```js
276277
{
277278
status: 403,
278279
error: 'Permission denied',
280+
url: 'http://example.net/noperm'
279281
headers: {
280282
'content-length': '247'
281283
}

0 commit comments

Comments
 (0)