| title | options( url, [body], [args] ) - Mock HTTP OPTIONS Requests with Mokapi JavaScript API |
|---|---|
| description | Use Mokapi's JavaScript API to mock HTTP OPTIONS requests. Customize responses, handle request data, and simulate APIs for testing and development. |
Make a OPTIONS request
| Parameter | Type | Description |
|---|---|---|
| url | string | Request URL like https://foo.bar |
| body | any | Request body, objects will be encoded as application/json |
| args (optional) | object | Args object containing additional request parameters |
| Type | Description |
|---|---|
| Response | Response object |
import { options } from 'mokapi/http'
export default function() {
const res = options("https://foo.bar/foo")
console.log(res.headers['Allow'])
}