From 09a3a92b6bd77bf7e9bef8a4cd1a8c500d2c1969 Mon Sep 17 00:00:00 2001 From: Etienne ANNE Date: Mon, 18 Mar 2024 21:30:50 +0100 Subject: [PATCH 1/2] Update invalid link to the example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b8ac899..9a9d34a 100644 --- a/README.md +++ b/README.md @@ -215,7 +215,7 @@ extism call plugin.wasm log_stuff --wasi --log-level=trace ## HTTP -Sometimes it is useful to let a plug-in [make HTTP calls](https://pkg.go.dev/github.com/extism/go-pdk#HTTPRequest.Send). [See this example](example/http.go) +Sometimes it is useful to let a plug-in [make HTTP calls](https://pkg.go.dev/github.com/extism/go-pdk#HTTPRequest.Send). [See this example](example/http/tiny_main.go) ```go //export http_get From 4caec41ef9f5aa7f5e9a554b64039f104df30b03 Mon Sep 17 00:00:00 2001 From: Etienne ANNE Date: Mon, 18 Mar 2024 21:35:01 +0100 Subject: [PATCH 2/2] Wrong first type of parameter given to NewHTTPRequest function --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a9d34a..dd5de86 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,7 @@ Sometimes it is useful to let a plug-in [make HTTP calls](https://pkg.go.dev/git //export http_get func httpGet() int32 { // create an HTTP Request (withuot relying on WASI), set headers as needed - req := pdk.NewHTTPRequest("GET", "https://jsonplaceholder.typicode.com/todos/1") + req := pdk.NewHTTPRequest(pdk.MethodGet, "https://jsonplaceholder.typicode.com/todos/1") req.SetHeader("some-name", "some-value") req.SetHeader("another", "again") // send the request, get response back (can check status on response via res.Status())