Skip to main content

Melon.http.requestAsync(resource, method, body, headers)

Requests an external resource.

Status: stable
Returns: Promise<Response>

Parameters

NameTypeDescription
resourcestringThe target resource to be fetched
methodstringThe operation http method
bodyRecord<string, any>The body to be sent in the request
headersRecord<string, any>The headers to be sent in the request

Example usage

const { requestAsync } = Melon.http; 

const result = await requestAsync("resource");