You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
' Use GetJSON helper to execute simple request and work with response
44
44
DimResourceAsString
45
45
DimResponseAsWebResponse
46
-
46
+
47
47
Resource="directions/json?"&_
48
48
"origin="&Origin&_
49
49
"&destination="&Destination&_
50
50
"&sensor=false"
51
51
SetResponse=MapsClient.GetJSON(Resource)
52
-
52
+
53
53
' => GET https://maps.../api/directions/json?origin=...&destination=...&sensor=false
54
-
54
+
55
55
ProcessDirectionsResponse
56
56
EndFunction
57
57
@@ -70,13 +70,13 @@ Public Sub ProcessDirections(Response As WebResponse)
70
70
EndSub
71
71
```
72
72
73
-
There are 3 primary components in VBA-Web:
73
+
There are 3 primary components in VBA-Web:
74
74
75
75
1.`WebRequest` for defining complex requests
76
76
2.`WebClient` for executing requests
77
-
3.`WebResponse` for dealing with responses.
78
-
79
-
In the above example, the request is fairly simple, so we can skip creating a `WebRequest` and instead use the `Client.GetJSON` helper to GET json from a specific url. In processing the response, we can look at the `StatusCode` to make sure the request succeeded and then use the parsed json in the `Data` parameter to extract complex information from the response.
77
+
3.`WebResponse` for dealing with responses.
78
+
79
+
In the above example, the request is fairly simple, so we can skip creating a `WebRequest` and instead use the `Client.GetJSON` helper to GET json from a specific url. In processing the response, we can look at the `StatusCode` to make sure the request succeeded and then use the parsed json in the `Data` parameter to extract complex information from the response.
80
80
81
81
### WebRequest Example
82
82
@@ -86,30 +86,30 @@ If you wish to have more control over the request, the following example uses `W
0 commit comments