Ask Your Question
4

What is the process for converting a cURL request to VBA WinHttp.WinHttpRequest.5.1?

asked 2022-05-13 11:00:00 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-10-03 22:00:00 +0000

scrum gravatar image
  1. Create a new instance of WinHttp.WinHttpRequest.5.1 object.
  2. Set the request method using the .Open method (e.g. .Open "GET", "http://www.example.com", false).
  3. Set any required request headers using the .SetRequestHeader method (e.g. .SetRequestHeader "Content-Type", "application/json").
  4. Set any required request data using the .Send method (e.g. .Send "{'key':'value'}").
  5. Retrieve the response headers using the .GetAllResponseHeaders method.
  6. Retrieve the response body using the .ResponseBody property.
  7. Handle the response as necessary (e.g. parse JSON response, write response to file, etc.).
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-05-13 11:00:00 +0000

Seen: 14 times

Last updated: Oct 03 '21