A simple HTTP request library based on the curl module.
In your project's zz.toml
file:
[repos]
zx = "https://github.com/zx-project/zx.git"
[dependencies]
http = "*"
Initiates a new GET
request with a tail variant
Response+length
configured with
RequestOptions
new+4096 res = http::get(RequestOptions { url: "https://example.com" });
TODO
TODO
using zxhttp::methods::{
DELETE,
GET,
HEAD,
PATCH,
POST,
PUT,
OPTIONS
}
TODO
using <stdio.h>::{ printf }
using zxhttp::{ RequestOptions }
using zxutils as utils
using zxhttp as http
fn main() -> int {
// `4000000` byte pool size
new+4000000 res = http::get(RequestOptions { url: "https://github.com" });
// iterate and output response headers
let mut headers = res.headers.iterator();
while !headers.ended {
let header = headers.next();
printf("< %s: %s\n", header->key, header->value);
}
printf("%s", res.data);
res.destroy();
return 0;
}
MIT