Module
Bucketchain.SimpleAPI.Batch
- Package
- purescript-bucketchain-simple-api
- Repository
- Bucketchain/purescript-bucketchain-simple-api
#BatchParams Source
type BatchParams = Array { body :: Foreign, path :: String }
This is for internal. Do not use it.
#Batch Source
newtype Batch a
The type for enable batch operation.
The batch operation is a mechanism running multiple Proc
in one HTTP request.
How to use:
withSimpleAPI appContext $ Batch { firstEndpoint, secondEndpoint }
Request POST /batch
with body:
[
{ "path": "/firstEndpoint" },
{ "path": "/secondEndpoint", "body": { "num": 1 } }
]
You will get results like:
[
{
"status": 500,
"body": { "message": "Internal server error" }
},
{
"status": 201,
"body": { "name": "foo" }
}
]
Note: POST /batch
responds 200 always.
Constructors
Batch a
- Modules
- Bucketchain.
SimpleAPI - Bucketchain.
SimpleAPI. Auth - Bucketchain.
SimpleAPI. Auth. Class - Bucketchain.
SimpleAPI. Batch - Bucketchain.
SimpleAPI. Body - Bucketchain.
SimpleAPI. Class - Bucketchain.
SimpleAPI. FreeT. Class - Bucketchain.
SimpleAPI. JSON - Bucketchain.
SimpleAPI. Proc - Bucketchain.
SimpleAPI. RawData - Bucketchain.
SimpleAPI. Response - Bucketchain.
SimpleAPI. Response. Class