New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] HTTP Module #23
Comments
This comment was marked as outdated.
This comment was marked as outdated.
I have just pushed the first implementation to the feature/http branch. In some sense, it may be smarter to implement this as As usual, the TypeScript bindings and API can be found here: https://github.com/Redfire75369/spiderfire/blob/feature/http/bindings/modules/typescript/http.d.ts. |
Since the main features are complete now, I'll be merging this into If anyone has any opinions or queries about the API or thinks I've missed out something important, please bring it up here. I'd like to hear about other's opinions on this. Here's an example of usage with the API, so you can judge ergonomics: import http, {Headers, Request} from "http";
const headers = new Headers([["Custom-Keep-Alive", "1000"], ["Custom-Cookies", "spider=fire"]]);
const request = new Request("http://www.example.com", { auth: "spider:fire", headers, signal: AbortSignal.timeout(150) });
const response = await http.request(request);
console.log(await response.text()); Here's a simpler example: import http from "http";
const response = await http.get("http://www.example.com");
console.log(await response.text()); |
The HTTP Client API for HTTP 0.9/1,0/1.1 has now been merged! |
I've been working on a HTTP module for a while now. I'm just stuck on a few of the API decisions, specifically on how to use the
Response
to get the data.If you have any other feedback on it, that'd be nice too.
Here's the current API in
http.d.ts
.<Removed as it is outdated, See below hidden comment>
The text was updated successfully, but these errors were encountered: