Skip to content

Commit

Permalink
Chapter 3 Lab Step 2: Fix R code for calling model API (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngroklee-ml authored Feb 3, 2024
1 parent 0457b3f commit c066563
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions chapters/sec1/1-3-data-access.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,16 @@ or equivalently in R
req <- httr2::request("http://127.0.0.1:8080/predict") |>
httr2::req_body_json(
list(
"bill_length_mm" = 0,
"species_Chinstrap" = FALSE,
"species_Gentoo" = FALSE,
"sex_male" = FALSE
list(
"bill_length_mm" = 0,
"species_Chinstrap" = FALSE,
"species_Gentoo" = FALSE,
"sex_male" = FALSE
)
)
) |>
httr2::req_perform()
res <- httr2::resp_body_json(r)$predict[[1]]
res <- httr2::resp_body_json(req)$predict[[1]]
```

Note that there's no translation necessary to send the request. The
Expand Down

0 comments on commit c066563

Please sign in to comment.