Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. private void GetSearchResponse(HttpWebRequest httpWebRequest)
  2. {
  3. try
  4. {
  5. using (var httpWebResponse = httpWebRequest.GetResponse() as HttpWebResponse)
  6. {
  7. using (var stream = httpWebResponse.GetResponseStream())
  8. {
  9. ProcessSearchResponse(stream);
  10. }
  11. }
  12. }
  13. catch (WebException ex)
  14. {//catch and log the error
  15. }
  16.  
  17.  
  18.  
  19. stack trace : "{"error":{"code":"-2147024891,
  20. System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access
  21. denied. You do not have permission to perform this action or access
  22. this resource."}}}"
  23.  
  24. [MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.]
  25.  
  26. request.Headers["X-RequestDigest"] = formDigestValue;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement