@@ -2,6 +2,7 @@ use crate::generated::exports::obelisk_flyio::activity_fly_http::machines::{
22 ExecResponse , Guest , Machine , MachineConfig ,
33} ;
44use crate :: generated:: obelisk_flyio:: activity_fly_http:: regions:: Region ;
5+ use crate :: wstd_util:: JsonRequest as _;
56use crate :: { API_BASE_URL , AppName , Component , MachineId , request_with_api_token} ;
67use anyhow:: { Context , anyhow, bail, ensure} ;
78use ser:: {
@@ -134,7 +135,7 @@ async fn create(
134135 let request = request_with_api_token ( ) ?
135136 . method ( Method :: POST )
136137 . uri ( url)
137- . body ( Body :: from_json ( & request_payload) ? ) ?;
138+ . json ( & request_payload) ?;
138139
139140 let response = Client :: new ( ) . send ( request) . await ?;
140141 let resp_status = response. status ( ) ;
@@ -175,7 +176,7 @@ async fn update(
175176 let request = request_with_api_token ( ) ?
176177 . method ( Method :: POST )
177178 . uri ( url)
178- . body ( Body :: from_json ( & request_payload) ? ) ?;
179+ . json ( & request_payload) ?;
179180
180181 let response = Client :: new ( ) . send ( request) . await ?;
181182 let resp_status = response. status ( ) ;
@@ -208,7 +209,7 @@ async fn exec(
208209 let request = request_with_api_token ( ) ?
209210 . method ( Method :: POST )
210211 . uri ( url)
211- . body ( Body :: from_json ( & body) ? ) ?;
212+ . json ( & body) ?;
212213 let response = Client :: new ( ) . send ( request) . await ?;
213214 let resp_status = response. status ( ) ;
214215 let mut response = response. into_body ( ) ;
0 commit comments