@@ -33,7 +33,7 @@ export interface HTTPResponse {
33
33
* ```typescript
34
34
* import { HTTP } from '@ionic-native/http';
35
35
*
36
- * constructor(private http: HTTP) { }
36
+ * constructor(private http: HTTP) {}
37
37
*
38
38
* ...
39
39
*
@@ -89,43 +89,80 @@ export class HTTP extends IonicNativePlugin {
89
89
useBasicAuth ( username : string , password : string ) : void { }
90
90
91
91
/**
92
- * Set a header for all future requests. Takes a header and a value.
92
+ * Get all headers defined for a given hostname.
93
+ * @param host {string} The hostname
94
+ * @returns {string } return all headers defined for the hostname
95
+ */
96
+ @Cordova ( { sync : true } )
97
+ getHeaders ( host : string ) : string {
98
+ return ;
99
+ }
100
+
101
+ /**
102
+ * Set a header for all future requests. Takes a hostname, a header and a value.
103
+ * @param host {string} The hostname to be used for scoping this header
93
104
* @param header {string} The name of the header
94
105
* @param value {string} The value of the header
95
106
*/
96
107
@Cordova ( { sync : true } )
97
- setHeader ( header : string , value : string ) : void { }
108
+ setHeader ( host : string , header : string , value : string ) : void { }
109
+
110
+ /**
111
+ * Get the name of the data serializer which will be used for all future POST and PUT requests.
112
+ * @returns {string } returns the name of the configured data serializer
113
+ */
114
+ @Cordova ( { sync : true } )
115
+ getDataSerializer ( ) : string {
116
+ return ;
117
+ }
98
118
99
119
/**
100
120
* Set the data serializer which will be used for all future POST and PUT requests. Takes a string representing the name of the serializer.
101
- * @param serializer {string} The name of the serializer. Can be urlencoded or json
121
+ * @param serializer {string} The name of the serializer. Can be urlencoded, utf8 or json
102
122
*/
103
123
@Cordova ( { sync : true } )
104
124
setDataSerializer ( serializer : string ) : void { }
105
125
106
126
/**
107
- * Clear all cookies
127
+ * Add a custom cookie.
128
+ * @param url {string} Scope of the cookie
129
+ * @param cookie {string} RFC compliant cookie string
130
+ */
131
+ @Cordova ( { sync : true } )
132
+ setCookie ( url : string , cookie : string ) : void { }
133
+
134
+ /**
135
+ * Clear all cookies.
108
136
*/
109
137
@Cordova ( { sync : true } )
110
138
clearCookies ( ) : void { }
111
139
112
140
/**
113
- * Remove cookies
141
+ * Remove cookies for given URL.
114
142
* @param url {string}
115
143
* @param cb
116
144
*/
117
145
@Cordova ( { sync : true } )
118
146
removeCookies ( url : string , cb : ( ) => void ) : void { }
119
147
120
148
/**
121
- * Disable following redirects automatically
122
- * @param disable {boolean} Set to true to disable following redirects automatically
149
+ * Resolve cookie string for given URL.
150
+ * @param url {string}
123
151
*/
124
152
@Cordova ( { sync : true } )
125
- disableRedirect ( disable : boolean ) : void { }
153
+ getCookieString ( url : string ) : string { return ; }
126
154
127
155
/**
128
- * Set request timeout
156
+ * Get global request timeout value in seconds.
157
+ * @returns {number } returns the global request timeout value
158
+ */
159
+ @Cordova ( { sync : true } )
160
+ getRequestTimeout ( ) : number {
161
+ return ;
162
+ }
163
+
164
+ /**
165
+ * Set global request timeout value in seconds.
129
166
* @param timeout {number} The timeout in seconds. Default 60
130
167
*/
131
168
@Cordova ( { sync : true } )
@@ -155,6 +192,14 @@ export class HTTP extends IonicNativePlugin {
155
192
return ;
156
193
}
157
194
195
+ /**
196
+ * Disable following redirects automatically.
197
+ * @param disable {boolean} Set to true to disable following redirects automatically
198
+ * @returns {Promise<void> } returns a promise that will resolve on success, and reject on failure
199
+ */
200
+ @Cordova ( )
201
+ disableRedirect ( disable : boolean ) : Promise < void > { return ; }
202
+
158
203
/**
159
204
* Make a POST request
160
205
* @param url {string} The url to send the request to
0 commit comments