Is it possible to form http requests without using curl, sockets, etc., and, for example, using js?

Started to familiarize himself with API SMS gateway

How can I create this request using cURL? Maybe you can do it with js? Because when I told the person who gave the assignment what are you trying to connect cURL - he said that this is not necessary, and you just need using js to get data from my database and generate query. Don't quite understand how to do it.
July 8th 19 at 16:05
5 answers
July 8th 19 at 16:07
Person proposes to comply with a request from the browser and to Shine the password, even hashed? Take and do not suffer.
July 8th 19 at 16:09
php - file_get_contents, fopen - i.e. using stream wrappers.

js - on the client haven't heard of it, on the server most likely, but there is need Node.js
July 8th 19 at 16:11
AJAX to help you.
right. The transmitted data can be read so that it is not good
July 8th 19 at 16:13
sockets here at anything, it's for TCP/IP, and here HTTP, any HTTP requests can be sent from server using Node.js or PHP, the simplest file_get_contents in PHP, but if from the client side (JavaScript), then using jQuery or XMLHttpRequest directly ( ), but to send requests from a browser requires that the server ( this is allowed (cross domain policy).
July 8th 19 at 16:15
var settings = {
 "async": true,
 "crossDomain": true,
 "url": "",
 "method": "GET",
 "headers": {
 "cache-control": "no-cache",

$.ajax(settings).done(function (response) {

Find more questions by tags JavaScriptAPIPHP