mirror of
https://github.com/nlepage/go-wasm-http-server.git
synced 2026-01-12 01:59:14 +00:00
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:
committed by
Nicolas Lepage
parent
d12a255cff
commit
ce6765e72a
11
request.go
11
request.go
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user