purescript-fetch/README.md

44 lines
641 B
Markdown
Raw Normal View History

2024-06-10 17:16:33 +00:00
# purescript-ezfetch
High-level bindings to the native `fetch` API
## `Effect.Aff.HTTP`
The main entry point is `Effect.Aff.HTTP.fetch`:
```purescript
fetch <method> <url> <options>
```
2024-06-10 17:23:09 +00:00
<ul>
<li>
`<method>` is `Effect.Aff.HTTP.Request.Method`:
```purescript
data Method
= GET
| PUT
| POST
| DELETE
| PATCH
| HEAD
```
</li>
<li>
`<url>` is `Data.URL.URL` (from [`url-immutable`](https://pursuit.purescript.org/packages/purescript-url-immutable/))
</li>
<li>
`<options>` is a partial record of:
```purescript
type OptionalFields =
( body :: Body
, headers :: Headers
, credentials :: Credentials
)
```
</li>
</ul>