mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-07-07 00:02:47 +08:00
update docu and change log
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## 1.10.0
|
||||
|
||||
- Feature #34: add new serializer "utf8" sending utf-8 encoded plain text (thanks robertocapuano)
|
||||
|
||||
## 1.9.1
|
||||
|
||||
- Fixed #45: does not encode arrays correctly as HTTP GET parameter on Android
|
||||
|
||||
@@ -63,7 +63,7 @@ This sets up all future requests to use Basic HTTP authentication with the given
|
||||
cordova.plugin.http.useBasicAuth('user', 'password');
|
||||
```
|
||||
|
||||
### setHeader
|
||||
### setHeader<a name="setHeader"></a>
|
||||
Set a header for all future requests to a specified host. Takes a hostname, a header and a value (must be a string value).
|
||||
|
||||
```js
|
||||
@@ -101,11 +101,14 @@ Set the data serializer which will be used for all future PATCH, POST and PUT re
|
||||
cordova.plugin.http.setDataSerializer('urlencoded');
|
||||
```
|
||||
|
||||
You can choose one of these two:
|
||||
You can choose one of these:
|
||||
* `urlencoded`: send data as url encoded content in body (content type "application/x-www-form-urlencoded")
|
||||
* `json`: send data as JSON encoded content in body (content type "application/json")
|
||||
* `utf8`: send data as plain UTF8 encoded string in body (content type "plain/text")
|
||||
|
||||
Caution: `urlencoded` does not support serializing deep structures whereas `json` does.
|
||||
You can also override the default content type headers by specifying your own headers (see [setHeader](#setHeader)).
|
||||
|
||||
__Caution__: `urlencoded` does not support serializing deep structures whereas `json` does.
|
||||
|
||||
### setRequestTimeout
|
||||
Set how long to wait for a request to respond, in seconds.
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ var pluginId = module.id.slice(0, module.id.lastIndexOf('.'));
|
||||
var cookieHandler = require(pluginId + '.cookie-handler');
|
||||
var messages = require(pluginId + '.messages');
|
||||
|
||||
var validSerializers = ['urlencoded', 'json', 'utf8' ];
|
||||
var validSerializers = [ 'urlencoded', 'json', 'utf8' ];
|
||||
|
||||
module.exports = {
|
||||
b64EncodeUnicode: b64EncodeUnicode,
|
||||
|
||||
Reference in New Issue
Block a user