Skip to content

Commit

Permalink
fix: Change URL import to require
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Finlinson committed Mar 27, 2019
1 parent 6ebecfc commit c63cff5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/webapi-node.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Guid, QueryOptions, Entity, RetrieveMultipleResponse, FunctionInput, ChangeSet, WebApiConfig, WebApiRequestConfig, WebApiRequestResult } from './models';
import * as webApi from "./webapi";
import { request } from "https";
import { URL } from "url";
import url = require("url");

function submitRequest(requestConfig: WebApiRequestConfig,
callback: (result: WebApiRequestResult) => void): void {
const url = new URL(`${requestConfig.apiConfig.url}/${requestConfig.queryString}`);
const apiUrl = new url.URL(`${requestConfig.apiConfig.url}/${requestConfig.queryString}`);

const headers: any = webApi.getHeaders(requestConfig);

const options = {
hostname: url.hostname,
path: `${url.pathname}${url.search}`,
hostname: apiUrl.hostname,
path: `${apiUrl.pathname}${apiUrl.search}`,
method: requestConfig.method,
headers: headers
};
Expand Down

0 comments on commit c63cff5

Please sign in to comment.