mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-07-26 00:00:14 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66dc8ff2ca | ||
|
|
91b35d561c | ||
|
|
45c0f8937f | ||
|
|
b1c8427986 | ||
|
|
91470725ee | ||
|
|
7cb41e0c1b | ||
|
|
ee8cae88a9 | ||
|
|
aa8105948e | ||
|
|
325a2e6200 |
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## v.1.5.10
|
||||
|
||||
- Fixed #10: fix gzip decompression when request header accepts gzip compression (thanks to DayBr3ak)
|
||||
- Fixed #13: fix angular integration for `setDataSerializer` (thanks to RangerRick)
|
||||
- Added some missing documentation (thanks to RangerRick)
|
||||
|
||||
## v1.5.9
|
||||
|
||||
- Fixed case-sensitive folder name of Android source files
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Mobisys GmbH
|
||||
Copyright (c) 2014 Wymsee, Inc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -18,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
||||
|
||||
@@ -67,6 +67,11 @@ You can choose one of these two:
|
||||
|
||||
Caution: `urlencoded` does not support serializing deep structures whereas `json` does.
|
||||
|
||||
### setRequestTimeout
|
||||
Set how long to wait for a request to respond, in seconds.
|
||||
|
||||
cordovaHTTP.setRequestTimeout(5.0);
|
||||
|
||||
### clearCookies
|
||||
Clear the cookie store.
|
||||
|
||||
@@ -106,6 +111,11 @@ Whether or not to validate the domain name in the certificate. This defaults to
|
||||
console.log('error :(');
|
||||
});
|
||||
|
||||
### removeCookies
|
||||
Remove all cookies associated with a given URL.
|
||||
|
||||
cordovaHTTP.removeCookies(url);
|
||||
|
||||
### post<a name="post"></a>
|
||||
Execute a POST request. Takes a URL, data, and headers.
|
||||
|
||||
@@ -173,6 +183,9 @@ Execute a PUT request. Takes a URL, data, and headers. See the [post](#post) d
|
||||
### delete
|
||||
Execute a DELETE request. Takes a URL, parameters, and headers. See the [post](#post) documentation for details on what is returned on success and failure.
|
||||
|
||||
### head
|
||||
Execute a HEAD request. Takes a URL, parameters, and headers. See the [post](#post) documentation for details on what is returned on success and failure.
|
||||
|
||||
### uploadFile
|
||||
Uploads a file saved on the device. Takes a URL, parameters, headers, filePath, and the name of the parameter to pass the file along as. See the [post](#post) documentation for details on what is returned on success and failure.
|
||||
|
||||
@@ -204,21 +217,9 @@ Downloads a file and saves it to the device. Takes a URL, parameters, headers,
|
||||
|
||||
## Libraries
|
||||
|
||||
This plugin utilizes some awesome open source networking libraries. These are both MIT licensed:
|
||||
This plugin utilizes some awesome open source networking libraries. These are both MIT licensed:
|
||||
|
||||
- iOS - [AFNetworking](https://github.com/AFNetworking/AFNetworking)
|
||||
- Android - [http-request](https://github.com/kevinsawicki/http-request)
|
||||
|
||||
We made a few modifications to http-request. They can be found in a separate repo here: https://github.com/wymsee/http-request
|
||||
|
||||
## License
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2014 Wymsee, Inc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
We made a few modifications to http-request.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cordova-plugin-advanced-http",
|
||||
"version": "1.5.9",
|
||||
"version": "1.5.10",
|
||||
"description": "Cordova / Phonegap plugin for communicating with HTTP servers using SSL pinning",
|
||||
"scripts": {
|
||||
"build": "cp node_modules/umd-tough-cookie/lib/umd-tough-cookie.js www/umd-tough-cookie.js",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
id="cordova-plugin-advanced-http"
|
||||
version="1.5.9">
|
||||
version="1.5.10">
|
||||
|
||||
<name>Advanced HTTP plugin</name>
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class CordovaHttpDelete extends CordovaHttp implements Runnable {
|
||||
this.setupSecurity(request);
|
||||
request.acceptCharset(CHARSET);
|
||||
request.headers(this.getHeadersMap());
|
||||
request.uncompress(true);
|
||||
|
||||
int code = request.code();
|
||||
String body = request.body(CHARSET);
|
||||
|
||||
@@ -37,6 +37,7 @@ class CordovaHttpDownload extends CordovaHttp implements Runnable {
|
||||
this.setupSecurity(request);
|
||||
request.acceptCharset(CHARSET);
|
||||
request.headers(this.getHeadersMap());
|
||||
request.uncompress(true);
|
||||
int code = request.code();
|
||||
|
||||
JSONObject response = new JSONObject();
|
||||
|
||||
@@ -30,6 +30,7 @@ class CordovaHttpGet extends CordovaHttp implements Runnable {
|
||||
this.setupSecurity(request);
|
||||
request.acceptCharset(CHARSET);
|
||||
request.headers(this.getHeadersMap());
|
||||
request.uncompress(true);
|
||||
|
||||
int code = request.code();
|
||||
String body = request.body(CHARSET);
|
||||
|
||||
@@ -29,6 +29,7 @@ class CordovaHttpHead extends CordovaHttp implements Runnable {
|
||||
this.setupSecurity(request);
|
||||
request.acceptCharset(CHARSET);
|
||||
request.headers(this.getHeadersMap());
|
||||
request.uncompress(true);
|
||||
|
||||
int code = request.code();
|
||||
JSONObject response = new JSONObject();
|
||||
|
||||
@@ -29,6 +29,7 @@ class CordovaHttpPost extends CordovaHttp implements Runnable {
|
||||
this.setupSecurity(request);
|
||||
request.acceptCharset(CHARSET);
|
||||
request.headers(this.getHeadersMap());
|
||||
request.uncompress(true);
|
||||
|
||||
if (new String("json").equals(this.getSerializerName())) {
|
||||
request.contentType(request.CONTENT_TYPE_JSON, request.CHARSET_UTF8);
|
||||
|
||||
@@ -29,6 +29,7 @@ class CordovaHttpPut extends CordovaHttp implements Runnable {
|
||||
this.setupSecurity(request);
|
||||
request.acceptCharset(CHARSET);
|
||||
request.headers(this.getHeadersMap());
|
||||
request.uncompress(true);
|
||||
|
||||
if (new String("json").equals(this.getSerializerName())) {
|
||||
request.contentType(request.CONTENT_TYPE_JSON, request.CHARSET_UTF8);
|
||||
|
||||
@@ -45,6 +45,7 @@ class CordovaHttpUpload extends CordovaHttp implements Runnable {
|
||||
this.setupSecurity(request);
|
||||
request.acceptCharset(CHARSET);
|
||||
request.headers(this.getHeadersMap());
|
||||
request.uncompress(true);
|
||||
|
||||
URI uri = new URI(filePath);
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -42,7 +42,7 @@ function registerService(http) {
|
||||
return http.setHeader(header, value);
|
||||
},
|
||||
setDataSerializer: function (serializer) {
|
||||
return http.setParamSerializer(serializer);
|
||||
return http.setDataSerializer(serializer);
|
||||
},
|
||||
clearCookies: function () {
|
||||
return http.clearCookies();
|
||||
|
||||
Reference in New Issue
Block a user