Guest User

Untitled

a guest
Mar 14th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. string url = ConfigurationManager.AppSettings["ArcGIS_Server_URL"] + "/tokens/generateToken/?f=pjson";
  2.  
  3. string data = string.Format("username={0}&password={1}&client=requestip&expiration={2}", username, password, ConfigurationManager.AppSettings["TokenExpirationTime"]);
  4.  
  5. url = string.Format("{0}&{1}", url, data);
  6.  
  7. // Create a new web request
  8. CustomWebRequest request = new CustomWebRequest(url, "POST");
  9. //Get Response
  10. string requestResult = request.GetResponse();
  11.  
  12. Generate Token request should not contain username and password in the query string
Add Comment
Please, Sign In to add comment