mirror of
https://github.com/monadicsystems/okapi.git
synced 2024-11-23 01:13:38 +03:00
Polish
This commit is contained in:
parent
bc2943df7b
commit
9514e22c29
@ -446,7 +446,7 @@ myServer = Server
|
||||
|
||||
#### DRY Endpoints
|
||||
|
||||
When implementing an API you will usually need the same path to have multiple methods, each with different parameters in the query, body and headers. Since Endpoints are records this is easy to deal with. Let's say we have a typical `/users/{userID : UserID}` route that accepts GET and PUT requests for fetching and updating a specific user respectively. The GET variant doesn't need a Body, but the PUT variant will.
|
||||
When implementing an API you will usually need the same path to have multiple methods, each with different parameters in the query, body and headers. Since Endpoints are records, this is easy to deal with. Let's say we have a typical `/users/{userID : UserID}` route that accepts GET and PUT requests for fetching and updating a specific user respectively. The GET variant doesn't need a Body, but the PUT variant will.
|
||||
|
||||
```haskell
|
||||
getUser = Endpoint
|
||||
|
@ -443,7 +443,7 @@ class="sourceCode haskell"><code class="sourceCode haskell"><span id="cb18-1"><a
|
||||
<h4>DRY Endpoints</h4>
|
||||
<p>When implementing an API you will usually need the same path to have
|
||||
multiple methods, each with different parameters in the query, body and
|
||||
headers. Since Endpoints are records this is easy to deal with. Let's
|
||||
headers. Since Endpoints are records, this is easy to deal with. Let's
|
||||
say we have a typical <code>/users/{userID : UserID}</code> route that
|
||||
accepts GET and PUT requests for fetching and updating a specific user
|
||||
respectively. The GET variant doesn't need a Body, but the PUT variant
|
||||
|
Loading…
Reference in New Issue
Block a user