Add curl sketch.

This commit is contained in:
Jesse Brault 2025-01-13 15:20:38 -06:00
parent d4fb4680a5
commit 085f60ab4f

15
sketching/curl.dms Normal file
View File

@ -0,0 +1,15 @@
use std::http::jsonClient
fn main = jsonClient() # json client
post 'http://localhost:1234/login', username: 'test', password: 'test' # Either<Err, Response>
-> || ( it.body.accessToken ) # Either<Error, *>
|> println # IO
()
# Without operators
fn main = jsonClient()
post 'http://localhost:1234/login', username: 'test', password: 'test'
map || ( it.body.accessToken )
fold println
()