зеркало из https://github.com/Azure/ms-rest-js.git
Fix build errors from fetchHttpClient and reference published isomorphic-tough-cookie
This commit is contained in:
Родитель
a1ec5314a1
Коммит
ad10be3024
|
@ -23,7 +23,7 @@ if (isNode) {
|
|||
* A HttpClient implementation that uses axios to send HTTP requests.
|
||||
*/
|
||||
export class AxiosHttpClient implements HttpClient {
|
||||
private readonly cookieJar = isNode ? new tough.CookieJar() : null;
|
||||
private readonly cookieJar = isNode ? new tough.CookieJar() : undefined;
|
||||
|
||||
public async sendRequest(httpRequest: WebResource): Promise<HttpOperationResponse> {
|
||||
if (!httpRequest) {
|
||||
|
@ -90,6 +90,7 @@ export class AxiosHttpClient implements HttpClient {
|
|||
method: httpRequest.method,
|
||||
url: httpRequest.url,
|
||||
headers: httpRequest.headers,
|
||||
// tslint:disable-next-line:no-null-keyword
|
||||
data: httpRequest.body === undefined ? null : httpRequest.body,
|
||||
transformResponse: undefined,
|
||||
validateStatus: () => true,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
export { WebResource, RequestPrepareOptions, HttpMethods, ParameterValue, RequestOptionsBase } from "./webResource";
|
||||
export { FetchHttpClient } from "./fetchHttpClient";
|
||||
export { AxiosHttpClient } from "./axiosHttpClient";
|
||||
export { HttpClient } from "./httpClient";
|
||||
export { HttpHeaders } from "./httpHeaders";
|
||||
export { HttpOperationResponse } from "./httpOperationResponse";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
import { ServiceClientCredentials } from "./credentials/serviceClientCredentials";
|
||||
import { FetchHttpClient } from "./fetchHttpClient";
|
||||
import { AxiosHttpClient } from "./axiosHttpClient";
|
||||
import { HttpClient } from "./httpClient";
|
||||
import { HttpOperationResponse } from "./httpOperationResponse";
|
||||
import { HttpPipelineLogger } from "./httpPipelineLogger";
|
||||
|
@ -110,7 +110,7 @@ export class ServiceClient {
|
|||
// do nothing
|
||||
}
|
||||
|
||||
this._httpClient = options.httpClient || new FetchHttpClient();
|
||||
this._httpClient = options.httpClient || new AxiosHttpClient();
|
||||
this._requestPolicyOptions = new RequestPolicyOptions(options.httpPipelineLogger);
|
||||
|
||||
this._requestPolicyCreators = options.requestPolicyCreators || createDefaultRequestPolicyCreators(credentials, options, this.userAgentInfo.value);
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
"is-buffer": "^2.0.0",
|
||||
"is-stream": "^1.1.0",
|
||||
"isomorphic-xml2js": "^0.0.3",
|
||||
"isomorphic-tough-cookie": "../isomorphic-tough-cookie",
|
||||
"isomorphic-tough-cookie": "^0.0.1",
|
||||
"url-parse": "^1.2.0",
|
||||
"uuid": "^3.2.1"
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче