var client = new RestClient("https://2factor.in/API/V1/{api_key}/SMS/{phone_number}/{otp_code}");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://2factor.in/API/V1/{api_key}/SMS/{phone_number}/{otp_code}");
xhr.send(data);
var http = require("https");
var options = {
"method": "POST",
"hostname": "2factor.in",
"port": null,
"path": "/API/V1/{api_key}/SMS/{phone_number}/{otp_code}",
"headers": {}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
var request = require("request");
var options = { method: 'POST',
url: 'https://2factor.in/API/V1/{api_key}/SMS/{phone_number}/{otp_code}' };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
var unirest = require("unirest");
var req = unirest("POST", "https://2factor.in/API/V1/{api_key}/SMS/{phone_number}/{otp_code}");
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "https://2factor.in/API/V1/{api_key}/SMS/{phone_number}/{otp_code}" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)