Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. {"@type":"login",
  2. "username":"xxx@gmail.com",
  3. "password":"yyy"
  4. }
  5.  
  6. $params = @{"@type"="login";
  7. "username"="xxx@gmail.com";
  8. "password"="yyy";
  9. }
  10.  
  11. Invoke-WebRequest -Uri http://foobar.com/endpoint -Method POST -Body $params
  12.  
  13. $JSON = @'
  14. {"@type":"login",
  15. "username":"xxx@gmail.com",
  16. "password":"yyy"
  17. }
  18. '@
  19.  
  20. $response = Invoke-RestMethod -Uri "http://somesite.com/oneendpoint" -Method Post -Body $JSON -ContentType "application/json"
  21.  
  22. $response = Invoke-WebRequest -Uri "http://somesite.com/oneendpoint" -Method Post -Body $JSON -ContentType "application/json"
  23.  
  24. $JSON = @{
  25. "@type" = "login"
  26. "username" = "xxx@gmail.com"
  27. "password" = "yyy"
  28. } | ConvertTo-Json
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement