Registers the methods of the module request in microTasks.
Send a request to a URI.
Name | Type | Default | Description |
---|---|---|---|
endopoint | object |
{} |
Request configuration |
[endopoint.body] | object |
{} |
Post body data |
[endopoint.headers] | object |
{} |
Headers |
[endopoint.hostname] | string |
Hostname: e.g. mail.google.com | |
[endopoint.method] | string |
"GET" |
Method: GET, POST, PATCH… |
[endopoint.path] | string |
"/" |
Path |
[endopoint.protocol] | string |
"https" |
Protocol: https or http |
[endopoint.port] | string |
Port |
Example
microTasks.taskRun([{
method: 'request.send',
params: {
body: { email: 'info@example.com', password: '12345678' },
hostname: 'app.example.com',
method: 'POST',
path: 'user/login',
protocol: 'https'
}
}])