Computer scienceBackendNode.jsCore ConceptsInternal modulesHTTP serverhttp module

Sending requests

Complex request

Report a typo

Write a request using options that can log the message stored in the message variable to the console.

const options = {
	hostname: 'myapi.com',
	port: 80,
	path: '/new',
	method: 'POST'
};

const message = 'Request sent!';
Enter a short text
___

Create a free account to access the full topic