Compare commits
	
		
			2 Commits
		
	
	
		
			085f60ab4f
			...
			f6c4d634ab
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | f6c4d634ab | ||
|   | a4c4357b31 | 
| @ -1,5 +1,8 @@ | ||||
| ns std::core | ||||
| 
 | ||||
| pub int String | ||||
| pub int String { | ||||
|     bytes: Array<Byte> | ||||
| } | ||||
| 
 | ||||
| impl StringImpl(fld bytes: Array<Byte>) : String | ||||
| #[internal] | ||||
| impl StringImpl(bytes) : String | ||||
|  | ||||
| @ -13,3 +13,16 @@ fn main = jsonClient() | ||||
|     map || ( it.body.accessToken ) | ||||
|     fold println | ||||
|     () | ||||
| 
 | ||||
| # Better: main which returns IO (a Callable?) automatically calls the IO | ||||
| # Also, JsonClient can "login" using various methods, such as a Bearer token | ||||
| 
 | ||||
| use std::http::{jsonClient, bearerToken} | ||||
| 
 | ||||
| fn main = jsonClient( | ||||
|     baseUrl: 'http:/localhost:1234', | ||||
|     auth: bearerToken || ( post('/login', username: 'test', password: 'test') map || ( it.body.accessToken ) ) | ||||
| ) | ||||
|     get '/greeting' | ||||
|     map || ( it.body.greeting ) | ||||
|     fold println | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user