16 lines
422 B
Plaintext
16 lines
422 B
Plaintext
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
|
|
()
|