mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Move stringifying of request body for azure REST calls (#22820)
* Move stringifying of request body for azure REST calls * spelling * Remove unused
This commit is contained in:
@@ -286,7 +286,7 @@ const networkRequestViaHttps = <T>(
|
|||||||
const isPostRequest = httpMethod === HttpMethod.POST;
|
const isPostRequest = httpMethod === HttpMethod.POST;
|
||||||
const isPutRequest = httpMethod === HttpMethod.PUT;
|
const isPutRequest = httpMethod === HttpMethod.PUT;
|
||||||
// Note: Text Encoder is necessary here because otherwise it was not able to handle Chinese characters in table names.
|
// Note: Text Encoder is necessary here because otherwise it was not able to handle Chinese characters in table names.
|
||||||
const body = (new TextEncoder()).encode(JSON.stringify(options?.body || ''));
|
const body = (new TextEncoder()).encode(options?.body || '');
|
||||||
const url = new URL(urlString);
|
const url = new URL(urlString);
|
||||||
const optionHeaders = options?.headers || {} as Record<string, string>;
|
const optionHeaders = options?.headers || {} as Record<string, string>;
|
||||||
let customOptions: https.RequestOptions = {
|
let customOptions: https.RequestOptions = {
|
||||||
|
|||||||
@@ -396,9 +396,10 @@ export async function makeHttpRequest(account: AzureAccount, subscription: azure
|
|||||||
...requestHeaders
|
...requestHeaders
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const body = JSON.stringify(requestBody || '');
|
||||||
let networkRequestOptions: NetworkRequestOptions = {
|
let networkRequestOptions: NetworkRequestOptions = {
|
||||||
headers: reqHeaders,
|
headers: reqHeaders,
|
||||||
body: requestBody
|
body
|
||||||
};
|
};
|
||||||
|
|
||||||
// Adding '/' if path does not begin with it.
|
// Adding '/' if path does not begin with it.
|
||||||
|
|||||||
Reference in New Issue
Block a user