Advertisement
Guest User

burger

a guest
Dec 29th, 2023
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. BROWSER:
  2. {
  3. "args": {},
  4. "headers": {
  5. "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
  6. "Accept-Encoding": "gzip, deflate, br",
  7. "Accept-Language": "en-US,en;q=0.5",
  8. "Dnt": "1",
  9. "Host": "httpbin.org",
  10. "Referer": "https://www.reddit.com/",
  11. "Sec-Fetch-Dest": "document",
  12. "Sec-Fetch-Mode": "navigate",
  13. "Sec-Fetch-Site": "cross-site",
  14. "Sec-Fetch-User": "?1",
  15. "Sec-Gpc": "1",
  16. "Upgrade-Insecure-Requests": "1",
  17. "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0",
  18. "X-Amzn-Trace-Id": "private"
  19. },
  20. "origin": "ip address",
  21. "url": "https://httpbin.org/get"
  22. }
  23.  
  24. LIBCPR:
  25. CODE:
  26. #include <cpr/cpr.h>
  27. #include <iostream>
  28.  
  29. int main() {
  30. cpr::Header headers = {{"User-Agent","Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0"}};
  31. cpr::Response response = cpr::Get(cpr::Url{"https://httpbin.org/get"},headers);
  32. std::cout << response.text << "\n";
  33. }
  34. RESULT:
  35. {
  36. "args": {},
  37. "headers": {
  38. "Accept": "*/*",
  39. "Accept-Encoding": "deflate, gzip, br, zstd",
  40. "Host": "httpbin.org",
  41. "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0",
  42. "X-Amzn-Trace-Id": "private"
  43. },
  44. "origin": "ip",
  45. "url": "https://httpbin.org/get"
  46. }
  47. REQWEST:
  48. CODE:
  49. fn main() -> Result<(), reqwest::Error> {
  50. let client = reqwest::blocking::Client::builder()
  51. .user_agent("Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0")
  52. .cookie_store(true)
  53. .build().unwrap();
  54. let res = client
  55. .get("https://httpbin.org/get")
  56. .header("Accept-Encoding", "deflate, gzip, br, zstd")
  57. .send()
  58. .unwrap();
  59. println!("Status code: {}", res.status());
  60. println!("{:?}", res.text());
  61. Ok(())
  62. }
  63. RESULT:
  64. {
  65. "args": {},
  66. "headers": {
  67. "Accept": "*/*",
  68. "Accept-Encoding": "deflate, gzip, br, zstd",
  69. "Host": "httpbin.org",
  70. "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0",
  71. "X-Amzn-Trace-Id": "private"
  72. },
  73. "origin": "ip",
  74. "url": "https://httpbin.org/get"
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement