Skip to content
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

Fix http section documentation #32

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ 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
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())
Expand Down
Loading