We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36a02ff commit 99e3239Copy full SHA for 99e3239
README.md
@@ -239,6 +239,22 @@ extism call plugin.wasm logStuff --wasi --log-level=info
239
# => 2023/10/17 14:25:00 Hello, World!
240
```
241
242
+### HTTP
243
+
244
+HTTP calls can be made using `Http.request`:
245
246
+```python
247
+import extism
248
249
+@extism.plugin_fn
250
+def call_http():
251
+ url = "https://jsonplaceholder.typicode.com/todos/1"
252
+ response = Http.request(url, meth="GET")
253
+ if response.status_code != 200:
254
+ raise Exception(f"Got non 200 response {response.status_code}")
255
+ extism.output_str(response.data_str())
256
+```
257
258
### Using Host Functions
259
260
You can defer logic to host functions from your plugin code.
0 commit comments