Skip to content

Commit

Permalink
Small fixes to python requests in Chapter 3 (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhicks2306 authored Feb 3, 2024
1 parent 61f4c70 commit d54404f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chapters/sec1/1-3-data-access.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ req_data = {
"species_Gentoo": False,
"sex_male": False
}
req = requests.post('http://127.0.0.1:8080/predict', json = req_data)
req = requests.post('http://127.0.0.1:8080/predict', json = [req_data])
res = req.json().get('predict')[0]
```

Expand Down Expand Up @@ -666,7 +666,7 @@ def server(input, output, session):
@reactive.Calc
@reactive.event(input.predict)
def pred():
r = requests.post(api_url, json = vals())
r = requests.post(api_url, json = [vals()])
return r.json().get('predict')[0]
@output
Expand Down

0 comments on commit d54404f

Please sign in to comment.