Skip to content

Commit 8d2782c

Browse files
authored
Fix http section documentation (#32)
* Update invalid link to the example * Wrong first type of parameter given to NewHTTPRequest function
1 parent fae85da commit 8d2782c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ extism call plugin.wasm log_stuff --wasi --log-level=trace
215215
216216
## HTTP
217217

218-
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)
218+
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)
219219

220220
```go
221221
//export http_get
222222
func httpGet() int32 {
223223
// create an HTTP Request (withuot relying on WASI), set headers as needed
224-
req := pdk.NewHTTPRequest("GET", "https://jsonplaceholder.typicode.com/todos/1")
224+
req := pdk.NewHTTPRequest(pdk.MethodGet, "https://jsonplaceholder.typicode.com/todos/1")
225225
req.SetHeader("some-name", "some-value")
226226
req.SetHeader("another", "again")
227227
// send the request, get response back (can check status on response via res.Status())

0 commit comments

Comments
 (0)