feat: Demonstrates TinyGo compatibility

Adds an example that demonstrates TinyGo compatibility, as well as using a server-side HTTP handler as a fallback.
This commit is contained in:
JP Hastings-Spital
2025-01-04 15:52:06 +00:00
committed by Nicolas Lepage
parent d12a255cff
commit ce6765e72a
10 changed files with 204 additions and 5 deletions

View File

@@ -64,10 +64,13 @@ func Request(uvalue js.Value) (*http.Request, error) {
}
req := &http.Request{
Method: method,
URL: u,
Body: bodyReader,
Header: make(http.Header),
Method: method,
URL: u,
Body: bodyReader,
Header: make(http.Header),
Proto: "HTTP/1.1",
ProtoMajor: 1,
ProtoMinor: 1,
}
headers, err := value.Get("headers")