Skip to content

Commit fba5bdb

Browse files
KoenZomersVesaJuvonen
authored andcommitted
Changed weatherservice mention to Typicode (SharePoint#3349)
* Changed weatherservice mention to Typicode The documentation mentioned to be having the same call into the weatherservice while in fact the sample was calling into the Typicode service. Updated the text so it's aligned with the sample. * Renamed weather variable name to response in samples Also renamed weather variable name to response variable name in the code
1 parent 6fda964 commit fba5bdb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/spfx/connect-to-anonymous-apis.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ When building SharePoint Framework solutions, you might want to consume public A
1515
1616
## Connect to anonymous APIs using the HttpClient
1717

18-
The easiest way, to connect to anonymous APIs in your SharePoint Framework solutions, is by using the HttpClient provided as a part of the SharePoint Framework. For example, to get weather information for London from the public OpenWeatherMap service, you would execute:
18+
The easiest way, to connect to anonymous APIs in your SharePoint Framework solutions, is by using the HttpClient provided as a part of the SharePoint Framework. For example, to get dummy information from the Typicode service, you would execute:
1919

2020
```ts
2121
this.context.httpClient
2222
.get('https://jsonplaceholder.typicode.com/todos/1', HttpClient.configurations.v1)
2323
.then((res: HttpClientResponse): Promise<any> => {
2424
return res.json();
2525
})
26-
.then((weather: any): void => {
27-
console.log(weather);
26+
.then((response: any): void => {
27+
console.log(response);
2828
});
2929
```
3030

@@ -41,8 +41,8 @@ this.context.httpClient
4141
.then((res: HttpClientResponse): Promise<any> => {
4242
return res.json();
4343
})
44-
.then((weather: any): void => {
45-
console.log(weather);
44+
.then((response: any): void => {
45+
console.log(response);
4646
});
4747
```
4848

0 commit comments

Comments
 (0)