using System.Net.Http.Headers;
using System.Threading.Tasks;
private static HttpClient httpClient = new HttpClient();
private static UriBuilder uriBuilder = new UriBuilder();
public static void Main()
static async Task GetISP() {
using(var httpClient = new HttpClient()){
var byteArray = Encoding.ASCII.GetBytes(_username + ":" + _password);
Console.WriteLine("PUT:");
HttpRequestMessage _reqMessage = new HttpRequestMessage();
string update_attributes = "{\"arealplanId\":{\"kommunenummer\":\"4601\",\"planidentifikasjon\":\"51290003\"},\"featuretype\":\"RpOmråde\",\"førsteDigitaliseringsdato\":\"2000-10-16T00:00:00\",\"identifikasjon\":{\"lokalId\":\"00124ede-068f-4f49-901a-be66f6a00a36\",\"navnerom\":\"http://data.geonorge.no/4601/Reguleringsplaner/so\",\"versjonId\":\"2020-06-10 14:49:01.930553000\"},\"ikrafttredelsesdato\":\"2000-10-16\",\"lovreferanse\":\"4\",\"oppdateringsdato\":\"2020-06-10T14:49:01\",\"opprinneligadministrativenhet\":\"1201\",\"opprinneligplanid\":\"51290003\",\"planbestemmelse\":\"4\",\"plannavn\":\"Test123abc abcde\",\"planstatus\":\"3\",\"plantype\":\"31\",\"vertikalnivå\":\"2\"}";
var content = new StringContent(update_attributes, Encoding.UTF8, "application/vnd.kartverket.ngis.attributes+json");
content.Headers.ContentType.Parameters.Add(new NameValueHeaderValue("version", "1.0"));
_reqMessage.Content = content;
_reqMessage.Method = HttpMethod.Put;
_reqMessage.RequestUri = new Uri(@"https://qmsrest.westeurope.cloudapp.azure.com:8080/v1/datasets/830da958-78a8-411b-9d98-555b342474b5/features/00124ede-068f-4f49-901a-be66f6a00a36/attributes");
_reqMessage.Headers.Authorization = new AuthenticationHeaderValue("Basic",Convert.ToBase64String(byteArray));
_reqMessage.Headers.Add("Accept", @"*/*");
HttpResponseMessage _httpRes = await httpClient.SendAsync(_reqMessage);
Console.WriteLine(_httpRes.StatusCode);
Console.WriteLine(_httpRes.ToString());
Console.WriteLine(_httpRes.Content.ReadAsStringAsync().Result);