Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 1.37 KB

File metadata and controls

30 lines (23 loc) · 1.37 KB
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.

options( url, [body], [args] )

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

Returns

Type Description
Response Response object

Example

import { options } from 'mokapi/http'

export default function() {
    const res = options("https://foo.bar/foo")
    console.log(res.headers['Allow'])
}