diff --git a/lib/axiosHttpClient.ts b/lib/axiosHttpClient.ts index 370cf77..fd06990 100644 --- a/lib/axiosHttpClient.ts +++ b/lib/axiosHttpClient.ts @@ -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 { 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, diff --git a/lib/msRest.ts b/lib/msRest.ts index fb21689..87b6f79 100644 --- a/lib/msRest.ts +++ b/lib/msRest.ts @@ -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"; diff --git a/lib/serviceClient.ts b/lib/serviceClient.ts index c6e206c..a4c8506 100644 --- a/lib/serviceClient.ts +++ b/lib/serviceClient.ts @@ -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); diff --git a/package.json b/package.json index d5c3d41..7ab1dc1 100644 --- a/package.json +++ b/package.json @@ -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" },