stdHTTP vs VBA-Web vs WinHttp #88
6DiegoDiego9
started this conversation in
General
Replies: 2 comments 1 reply
-
stdHTTPPros
Cons
Exampleconst URL as string = "https://www.googleapis.com/gmail/v1/users/{userId}/messages/{messageId}"
Dim q as string: q = URL
q = replace(q, "{userId}", whatever)
q = replace(q, "{messageId}", whatever)
set o = stdHTTP.Create(q) VBA-WebPros
Cons
ExampleFunction LoadMessage(MessageId As String) As Dictionary
Dim GmailClient as New WebClient
GmailClient.BaseUrl = "https://www.googleapis.com/gmail/v1/"
Dim Request As New WebRequest
Request.Resource = "users/{userId}/messages/{messageId}"
Request.AddUrlSegment "userId", "me"
Request.AddUrlSegment "messageId", MessageId
Dim Response As WebResponse
Set Response = GmailClient.Execute(Request)
End Function My personal opinion is i'd rather have something like |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the info! As far as I understand, the following short form works with VBA-Web, as long as the classes are set to be predeclared like stdHTTP:
Please correct me if I'm wrong |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm in the process of comparing stdHTTP vs VBA-Web vs standard WinHttp to decide what library to use for http communications in VBA.
What are the main advantages and disadvantages of stdHTTP compared to the other two?
Beta Was this translation helpful? Give feedback.
All reactions