Arya raj

Arya raj

  • NA
  • 57
  • 34.8k

how to fetch groupName and typeName from httpRequestMessage

Jul 18 2019 2:23 AM
  1. [Route("api/v1/DRS/FileUpload/GetAttribues/{groupName}/{typeName}")]  
  2. [HttpGet]  
  3. public async Task<HttpResponseMessage>  
  4. GetAttribues(HttpRequestMessage Attri)  
  5. {  
  6. Debugger.Launch();  
  7. try  
  8. {  
  9. using (HttpClient client = new HttpClient())  
  10. {  
  11. client.DefaultRequestHeaders.Accept.Clear(); //String  
  12. path=Request.Url.GetLeftPart(UriPartial.Path);  
  13. HttpResponseMessage response = await client.GetAsync("http://localhost:8089/document/getattributes/" +);  
  14. if (response.IsSuccessStatusCode)  
  15. {  
  16. Console.Write("Success");  
  17. }  
  18. else  
  19. {  
  20. Console.Write("Failure");  
  21. }  
  22. return response;  
  23. }  
  24. }  
  25. catch (Exception e)  
  26. {  
  27. throw e;  
  28. }

Answers (2)