marianoguerra/megalodon/api does not have a README file
pub(open) trait Transport {
async fn send(Self, HttpRequest) -> HttpResponse
fn describe(Self) -> String
}pub(all) suberror MegalodonError {
InvalidRequest(String)
RequestFailed(String)
HttpStatus(status~ : Int, body~ : String, headers~ : Map[String, String])
PartialContent(headers~ : Map[String, String])
InvalidJson(String)
InvalidEntity(entity~ : String, detail~ : String)
UnknownServer(String)
NodeInfo(String)
} derive(Debug)pub(all) struct HttpRequest {
url : String
http_method : HttpMethod
headers : Map[String, String]
body : Bytes
} derive(Eq, Debug)pub(all) struct Response[T] {
data : T
status : Int
headers : Map[String, String]
pagination : Pagination
} derive(Eq, Debug)fn build_request(base_url : String, path : String, http_method : HttpMethod, query? : Params, body? : RequestBody, access_token? : String, user_agent? : String, extra_headers? : Map[String, String]) -> HttpRequestfn multipart_file(boundary : String, field_name : String, file_name : String, mime_type : String, bytes : Bytes, fields? : Array[(String, String)]) -> MultipartBody raise MegalodonErrorfn percent_encode(text : String) -> StringA portable Mastodon-compatible Fediverse API client for MoonBit.