extism / go-pdk

Extism Plug-in Development Kit (PDK) for Go
https://pkg.go.dev/github.com/extism/go-pdk
BSD 3-Clause "New" or "Revised" License
60 stars 11 forks source link

feat: implement extism_http_request #7

Closed nilslice closed 1 year ago

nilslice commented 1 year ago

It's real close... I can get a status code from the HTTPResponse, but stuck unable to get the loaded http response body from the runtime using the offset returned from extism_http_request.

To test:

make example
make test

Will build and test the existing example, as well as the new one in example/http.go

@zshipko - I think I'll need you to take a look at what I could be doing wrong, particularly in the place where I try to load the memory before the end of HTTPRequest.Send()