PUT DiagnosticSettings_CreateOrUpdate
{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
QUERY PARAMS

resourceUri
name
BODY json

{
  "properties": {
    "eventHubAuthorizationRuleId": "",
    "eventHubName": "",
    "logAnalyticsDestinationType": "",
    "logs": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {
          "days": 0,
          "enabled": false
        }
      }
    ],
    "metrics": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {},
        "timeGrain": ""
      }
    ],
    "serviceBusRuleId": "",
    "storageAccountId": "",
    "workspaceId": ""
  }
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/put "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name" {:content-type :json
                                                                                                              :form-params {:properties {:eventHubAuthorizationRuleId ""
                                                                                                                                         :eventHubName ""
                                                                                                                                         :logAnalyticsDestinationType ""
                                                                                                                                         :logs [{:category ""
                                                                                                                                                 :enabled false
                                                                                                                                                 :retentionPolicy {:days 0
                                                                                                                                                                   :enabled false}}]
                                                                                                                                         :metrics [{:category ""
                                                                                                                                                    :enabled false
                                                                                                                                                    :retentionPolicy {}
                                                                                                                                                    :timeGrain ""}]
                                                                                                                                         :serviceBusRuleId ""
                                                                                                                                         :storageAccountId ""
                                                                                                                                         :workspaceId ""}}})
require "http/client"

url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"
headers = HTTP::Headers{
  "content-type" => "application/json"
}
reqBody = "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}"

response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Put,
    RequestUri = new Uri("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"),
    Content = new StringContent("{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

	payload := strings.NewReader("{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
PUT /baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 524

{
  "properties": {
    "eventHubAuthorizationRuleId": "",
    "eventHubName": "",
    "logAnalyticsDestinationType": "",
    "logs": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {
          "days": 0,
          "enabled": false
        }
      }
    ],
    "metrics": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {},
        "timeGrain": ""
      }
    ],
    "serviceBusRuleId": "",
    "storageAccountId": "",
    "workspaceId": ""
  }
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"))
    .header("content-type", "application/json")
    .method("PUT", HttpRequest.BodyPublishers.ofString("{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .put(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .header("content-type", "application/json")
  .body("{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}")
  .asString();
const data = JSON.stringify({
  properties: {
    eventHubAuthorizationRuleId: '',
    eventHubName: '',
    logAnalyticsDestinationType: '',
    logs: [
      {
        category: '',
        enabled: false,
        retentionPolicy: {
          days: 0,
          enabled: false
        }
      }
    ],
    metrics: [
      {
        category: '',
        enabled: false,
        retentionPolicy: {},
        timeGrain: ''
      }
    ],
    serviceBusRuleId: '',
    storageAccountId: '',
    workspaceId: ''
  }
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('PUT', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name',
  headers: {'content-type': 'application/json'},
  data: {
    properties: {
      eventHubAuthorizationRuleId: '',
      eventHubName: '',
      logAnalyticsDestinationType: '',
      logs: [{category: '', enabled: false, retentionPolicy: {days: 0, enabled: false}}],
      metrics: [{category: '', enabled: false, retentionPolicy: {}, timeGrain: ''}],
      serviceBusRuleId: '',
      storageAccountId: '',
      workspaceId: ''
    }
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name';
const options = {
  method: 'PUT',
  headers: {'content-type': 'application/json'},
  body: '{"properties":{"eventHubAuthorizationRuleId":"","eventHubName":"","logAnalyticsDestinationType":"","logs":[{"category":"","enabled":false,"retentionPolicy":{"days":0,"enabled":false}}],"metrics":[{"category":"","enabled":false,"retentionPolicy":{},"timeGrain":""}],"serviceBusRuleId":"","storageAccountId":"","workspaceId":""}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name',
  method: 'PUT',
  headers: {
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "properties": {\n    "eventHubAuthorizationRuleId": "",\n    "eventHubName": "",\n    "logAnalyticsDestinationType": "",\n    "logs": [\n      {\n        "category": "",\n        "enabled": false,\n        "retentionPolicy": {\n          "days": 0,\n          "enabled": false\n        }\n      }\n    ],\n    "metrics": [\n      {\n        "category": "",\n        "enabled": false,\n        "retentionPolicy": {},\n        "timeGrain": ""\n      }\n    ],\n    "serviceBusRuleId": "",\n    "storageAccountId": "",\n    "workspaceId": ""\n  }\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .put(body)
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'PUT',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name',
  headers: {
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  properties: {
    eventHubAuthorizationRuleId: '',
    eventHubName: '',
    logAnalyticsDestinationType: '',
    logs: [{category: '', enabled: false, retentionPolicy: {days: 0, enabled: false}}],
    metrics: [{category: '', enabled: false, retentionPolicy: {}, timeGrain: ''}],
    serviceBusRuleId: '',
    storageAccountId: '',
    workspaceId: ''
  }
}));
req.end();
const request = require('request');

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name',
  headers: {'content-type': 'application/json'},
  body: {
    properties: {
      eventHubAuthorizationRuleId: '',
      eventHubName: '',
      logAnalyticsDestinationType: '',
      logs: [{category: '', enabled: false, retentionPolicy: {days: 0, enabled: false}}],
      metrics: [{category: '', enabled: false, retentionPolicy: {}, timeGrain: ''}],
      serviceBusRuleId: '',
      storageAccountId: '',
      workspaceId: ''
    }
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('PUT', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');

req.headers({
  'content-type': 'application/json'
});

req.type('json');
req.send({
  properties: {
    eventHubAuthorizationRuleId: '',
    eventHubName: '',
    logAnalyticsDestinationType: '',
    logs: [
      {
        category: '',
        enabled: false,
        retentionPolicy: {
          days: 0,
          enabled: false
        }
      }
    ],
    metrics: [
      {
        category: '',
        enabled: false,
        retentionPolicy: {},
        timeGrain: ''
      }
    ],
    serviceBusRuleId: '',
    storageAccountId: '',
    workspaceId: ''
  }
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name',
  headers: {'content-type': 'application/json'},
  data: {
    properties: {
      eventHubAuthorizationRuleId: '',
      eventHubName: '',
      logAnalyticsDestinationType: '',
      logs: [{category: '', enabled: false, retentionPolicy: {days: 0, enabled: false}}],
      metrics: [{category: '', enabled: false, retentionPolicy: {}, timeGrain: ''}],
      serviceBusRuleId: '',
      storageAccountId: '',
      workspaceId: ''
    }
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name';
const options = {
  method: 'PUT',
  headers: {'content-type': 'application/json'},
  body: '{"properties":{"eventHubAuthorizationRuleId":"","eventHubName":"","logAnalyticsDestinationType":"","logs":[{"category":"","enabled":false,"retentionPolicy":{"days":0,"enabled":false}}],"metrics":[{"category":"","enabled":false,"retentionPolicy":{},"timeGrain":""}],"serviceBusRuleId":"","storageAccountId":"","workspaceId":""}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"properties": @{ @"eventHubAuthorizationRuleId": @"", @"eventHubName": @"", @"logAnalyticsDestinationType": @"", @"logs": @[ @{ @"category": @"", @"enabled": @NO, @"retentionPolicy": @{ @"days": @0, @"enabled": @NO } } ], @"metrics": @[ @{ @"category": @"", @"enabled": @NO, @"retentionPolicy": @{  }, @"timeGrain": @"" } ], @"serviceBusRuleId": @"", @"storageAccountId": @"", @"workspaceId": @"" } };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}" in

Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'properties' => [
        'eventHubAuthorizationRuleId' => '',
        'eventHubName' => '',
        'logAnalyticsDestinationType' => '',
        'logs' => [
                [
                                'category' => '',
                                'enabled' => null,
                                'retentionPolicy' => [
                                                                'days' => 0,
                                                                'enabled' => null
                                ]
                ]
        ],
        'metrics' => [
                [
                                'category' => '',
                                'enabled' => null,
                                'retentionPolicy' => [
                                                                
                                ],
                                'timeGrain' => ''
                ]
        ],
        'serviceBusRuleId' => '',
        'storageAccountId' => '',
        'workspaceId' => ''
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('PUT', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name', [
  'body' => '{
  "properties": {
    "eventHubAuthorizationRuleId": "",
    "eventHubName": "",
    "logAnalyticsDestinationType": "",
    "logs": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {
          "days": 0,
          "enabled": false
        }
      }
    ],
    "metrics": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {},
        "timeGrain": ""
      }
    ],
    "serviceBusRuleId": "",
    "storageAccountId": "",
    "workspaceId": ""
  }
}',
  'headers' => [
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');
$request->setMethod(HTTP_METH_PUT);

$request->setHeaders([
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'properties' => [
    'eventHubAuthorizationRuleId' => '',
    'eventHubName' => '',
    'logAnalyticsDestinationType' => '',
    'logs' => [
        [
                'category' => '',
                'enabled' => null,
                'retentionPolicy' => [
                                'days' => 0,
                                'enabled' => null
                ]
        ]
    ],
    'metrics' => [
        [
                'category' => '',
                'enabled' => null,
                'retentionPolicy' => [
                                
                ],
                'timeGrain' => ''
        ]
    ],
    'serviceBusRuleId' => '',
    'storageAccountId' => '',
    'workspaceId' => ''
  ]
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'properties' => [
    'eventHubAuthorizationRuleId' => '',
    'eventHubName' => '',
    'logAnalyticsDestinationType' => '',
    'logs' => [
        [
                'category' => '',
                'enabled' => null,
                'retentionPolicy' => [
                                'days' => 0,
                                'enabled' => null
                ]
        ]
    ],
    'metrics' => [
        [
                'category' => '',
                'enabled' => null,
                'retentionPolicy' => [
                                
                ],
                'timeGrain' => ''
        ]
    ],
    'serviceBusRuleId' => '',
    'storageAccountId' => '',
    'workspaceId' => ''
  ]
]));
$request->setRequestUrl('{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders([
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
  "properties": {
    "eventHubAuthorizationRuleId": "",
    "eventHubName": "",
    "logAnalyticsDestinationType": "",
    "logs": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {
          "days": 0,
          "enabled": false
        }
      }
    ],
    "metrics": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {},
        "timeGrain": ""
      }
    ],
    "serviceBusRuleId": "",
    "storageAccountId": "",
    "workspaceId": ""
  }
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
  "properties": {
    "eventHubAuthorizationRuleId": "",
    "eventHubName": "",
    "logAnalyticsDestinationType": "",
    "logs": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {
          "days": 0,
          "enabled": false
        }
      }
    ],
    "metrics": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {},
        "timeGrain": ""
      }
    ],
    "serviceBusRuleId": "",
    "storageAccountId": "",
    "workspaceId": ""
  }
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}"

headers = { 'content-type': "application/json" }

conn.request("PUT", "/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

payload = { "properties": {
        "eventHubAuthorizationRuleId": "",
        "eventHubName": "",
        "logAnalyticsDestinationType": "",
        "logs": [
            {
                "category": "",
                "enabled": False,
                "retentionPolicy": {
                    "days": 0,
                    "enabled": False
                }
            }
        ],
        "metrics": [
            {
                "category": "",
                "enabled": False,
                "retentionPolicy": {},
                "timeGrain": ""
            }
        ],
        "serviceBusRuleId": "",
        "storageAccountId": "",
        "workspaceId": ""
    } }
headers = {"content-type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

payload <- "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}"

encode <- "json"

response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.put('/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name') do |req|
  req.body = "{\n  \"properties\": {\n    \"eventHubAuthorizationRuleId\": \"\",\n    \"eventHubName\": \"\",\n    \"logAnalyticsDestinationType\": \"\",\n    \"logs\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {\n          \"days\": 0,\n          \"enabled\": false\n        }\n      }\n    ],\n    \"metrics\": [\n      {\n        \"category\": \"\",\n        \"enabled\": false,\n        \"retentionPolicy\": {},\n        \"timeGrain\": \"\"\n      }\n    ],\n    \"serviceBusRuleId\": \"\",\n    \"storageAccountId\": \"\",\n    \"workspaceId\": \"\"\n  }\n}"
end

puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name";

    let payload = json!({"properties": json!({
            "eventHubAuthorizationRuleId": "",
            "eventHubName": "",
            "logAnalyticsDestinationType": "",
            "logs": (
                json!({
                    "category": "",
                    "enabled": false,
                    "retentionPolicy": json!({
                        "days": 0,
                        "enabled": false
                    })
                })
            ),
            "metrics": (
                json!({
                    "category": "",
                    "enabled": false,
                    "retentionPolicy": json!({}),
                    "timeGrain": ""
                })
            ),
            "serviceBusRuleId": "",
            "storageAccountId": "",
            "workspaceId": ""
        })});

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request PUT \
  --url {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name \
  --header 'content-type: application/json' \
  --data '{
  "properties": {
    "eventHubAuthorizationRuleId": "",
    "eventHubName": "",
    "logAnalyticsDestinationType": "",
    "logs": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {
          "days": 0,
          "enabled": false
        }
      }
    ],
    "metrics": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {},
        "timeGrain": ""
      }
    ],
    "serviceBusRuleId": "",
    "storageAccountId": "",
    "workspaceId": ""
  }
}'
echo '{
  "properties": {
    "eventHubAuthorizationRuleId": "",
    "eventHubName": "",
    "logAnalyticsDestinationType": "",
    "logs": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {
          "days": 0,
          "enabled": false
        }
      }
    ],
    "metrics": [
      {
        "category": "",
        "enabled": false,
        "retentionPolicy": {},
        "timeGrain": ""
      }
    ],
    "serviceBusRuleId": "",
    "storageAccountId": "",
    "workspaceId": ""
  }
}' |  \
  http PUT {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name \
  content-type:application/json
wget --quiet \
  --method PUT \
  --header 'content-type: application/json' \
  --body-data '{\n  "properties": {\n    "eventHubAuthorizationRuleId": "",\n    "eventHubName": "",\n    "logAnalyticsDestinationType": "",\n    "logs": [\n      {\n        "category": "",\n        "enabled": false,\n        "retentionPolicy": {\n          "days": 0,\n          "enabled": false\n        }\n      }\n    ],\n    "metrics": [\n      {\n        "category": "",\n        "enabled": false,\n        "retentionPolicy": {},\n        "timeGrain": ""\n      }\n    ],\n    "serviceBusRuleId": "",\n    "storageAccountId": "",\n    "workspaceId": ""\n  }\n}' \
  --output-document \
  - {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
import Foundation

let headers = ["content-type": "application/json"]
let parameters = ["properties": [
    "eventHubAuthorizationRuleId": "",
    "eventHubName": "",
    "logAnalyticsDestinationType": "",
    "logs": [
      [
        "category": "",
        "enabled": false,
        "retentionPolicy": [
          "days": 0,
          "enabled": false
        ]
      ]
    ],
    "metrics": [
      [
        "category": "",
        "enabled": false,
        "retentionPolicy": [],
        "timeGrain": ""
      ]
    ],
    "serviceBusRuleId": "",
    "storageAccountId": "",
    "workspaceId": ""
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
DELETE DiagnosticSettings_Delete
{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
QUERY PARAMS

resourceUri
name
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/delete "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
require "http/client"

url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Delete,
    RequestUri = new Uri("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

	req, _ := http.NewRequest("DELETE", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
DELETE /baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"))
    .method("DELETE", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .delete(null)
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('DELETE', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name';
const options = {method: 'DELETE'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name',
  method: 'DELETE',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .delete(null)
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'DELETE',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name',
  headers: {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name'
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('DELETE', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name';
const options = {method: 'DELETE'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name" in

Client.call `DELETE uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('DELETE', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');

echo $response->getBody();
setUrl('{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');
$request->setMethod(HTTP_METH_DELETE);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name' -Method DELETE 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name' -Method DELETE 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("DELETE", "/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

response = requests.delete(url)

print(response.json())
library(httr)

url <- "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

response <- VERB("DELETE", url, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.delete('/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name') do |req|
end

puts response.status
puts response.body
use std::str::FromStr;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name";

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request DELETE \
  --url {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
http DELETE {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
wget --quiet \
  --method DELETE \
  --output-document \
  - {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
GET DiagnosticSettings_Get
{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
QUERY PARAMS

resourceUri
name
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
require "http/client"

url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .get()
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('GET', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name',
  method: 'GET',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")
  .get()
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name',
  headers: {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name'
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name" in

Client.call `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');

echo $response->getBody();
setUrl('{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');
$request->setMethod(HTTP_METH_GET);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name' -Method GET 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name' -Method GET 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("GET", "/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

response = requests.get(url)

print(response.json())
library(httr)

url <- "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name"

response <- VERB("GET", url, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name') do |req|
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name";

    let client = reqwest::Client::new();
    let response = client.get(url)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
http GET {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
wget --quiet \
  --method GET \
  --output-document \
  - {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings/:name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
GET DiagnosticSettings_List
{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings
QUERY PARAMS

resourceUri
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings")
require "http/client"

url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings"

response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings")
  .get()
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('GET', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings',
  method: 'GET',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings")
  .get()
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings',
  headers: {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings'
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings');

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings" in

Client.call `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings');

echo $response->getBody();
setUrl('{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings');
$request->setMethod(HTTP_METH_GET);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings' -Method GET 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings' -Method GET 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("GET", "/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings"

response = requests.get(url)

print(response.json())
library(httr)

url <- "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings"

response <- VERB("GET", url, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/:resourceUri/providers/Microsoft.Insights/diagnosticSettings') do |req|
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings";

    let client = reqwest::Client::new();
    let response = client.get(url)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings
http GET {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings
wget --quiet \
  --method GET \
  --output-document \
  - {{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:resourceUri/providers/Microsoft.Insights/diagnosticSettings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()