Skip to main content

create_session

Function create_session 

Source
pub async fn create_session(
    __arg0: State<AppState>,
    _req: Option<Json<CreateSessionRequest>>,
) -> Result<(StatusCode, Json<CreateSessionResponse>), (StatusCode, Json<ErrorResponse>)>
Expand description

Create a new session. The body is optional because the request carries no fields: POST /sessions with nothing at all is the natural call. A body that is sent still has to parse, so a caller who passes the old shell/working_dir/env is told so rather than having them dropped.