diff --git a/chapters/sec1/1-3-data-access.qmd b/chapters/sec1/1-3-data-access.qmd index ed0e1925..1829ba40 100644 --- a/chapters/sec1/1-3-data-access.qmd +++ b/chapters/sec1/1-3-data-access.qmd @@ -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] ``` @@ -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