Hi Jonathan,
i have used same HttpWebResponse when i get the response
HttpWebResponse := HttpWebRequest.GetResponse;
in the above statement i got an error "Remote server can be found (404) : Bad request" but this is not an exact error Email address not exist my error to get an exact error message i have used System.net.Http dll see below my code
HttpContent := StringContent.StringContent(Json,SText.UTF8,'application/json');
HttpClient := HttpClient.HttpClient;
HttpClient.DefaultRequestHeaders.Authorization := HttpHeader.AuthenticationHeaderValue('Bearer','xg7s6d17jc70l6vebduhyxjugp4a78hk');
HttpResponseMessage := HttpResponseMessage.HttpResponseMessage;
IF MagentoConnectionP."HTTP Request Method" = 'POST' THEN
HttpResponseMessage := HttpClient.PostAsync(MagentoRestAPIURL,HttpContent).Result;
IF MagentoConnectionP."HTTP Request Method" = 'PUT' THEN
HttpResponseMessage := HttpClient.PutAsync(MagentoRestAPIURL,HttpContent).Result;
IF MagentoConnectionP."HTTP Request Method" = 'GET' THEN
HttpResponseMessage := HttpClient.GetAsync(MagentoRestAPIURL).Result;
HandleText := HttpResponseMessage.Content.ReadAsStringAsync().Result;
ERROR(HandleText);
see dll variables i used here
Name DataType Subtype Length
HttpResponseMessage DotNet System.Net.Http.HttpResponseMessage.'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
HttpClient DotNet System.Net.Http.HttpClient.'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
HttpContent DotNet System.Net.Http.HttpContent.'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
StringContent DotNet System.Net.Http.StringContent.'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
HttpHeader DotNet System.Net.Http.Headers.AuthenticationHeaderValue.'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
All the variables belongs to System.Net.Http dll but i con't find this dll in nav 2009 R2 is there any alternate solution for this.
Thank You
Ramesh