Compare commits

..
9 Commits
Author SHA1 Message Date
Sefa Ilkimen 66dc8ff2ca changed readme file 2017-09-26 10:48:06 +02:00
Sefa Ilkimen 91b35d561c - updated version number
- updated change log
2017-09-26 10:38:16 +02:00
Sefa IlkimenandGitHub 45c0f8937f Merge pull request #14 from RangerRick/fix-serialization
change setParamSerializer to setDataSerializer (fixes #13)
2017-09-26 11:15:19 +03:00
Sefa IlkimenandGitHub b1c8427986 Merge pull request #15 from RangerRick/documentation-updates
add missing documentation
2017-09-26 11:05:34 +03:00
Benjamin Reed 91470725ee add missing documentation for setRequestTimeout, removeCookies, and head 2017-09-25 16:12:40 -04:00
Benjamin Reed 7cb41e0c1b change setParamSerializer to setDataSerializer (fixes #13) 2017-09-25 14:51:57 -04:00
Sefa Ilkimen ee8cae88a9 updated change log 2017-09-12 19:05:23 +03:00
Sefa IlkimenandGitHub aa8105948e Merge pull request #10 from DayBr3ak/master
fix gzip decompression when request header accepts gzip compression
2017-09-12 19:00:31 +03:00
ben 325a2e6200 fix gzip decompression when request header accepts gzip compression 2017-09-12 14:17:52 +02:00
13 changed files with 33 additions and 18 deletions
+6
View File
@@ -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
+2 -1
View File
@@ -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.
+15 -14
View File
@@ -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
View File
@@ -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
View File
@@ -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);
+1 -1
View File
@@ -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();