You can expand and use the authorization header but as we use URL variables for all parameters you can just use API key and more within the URL parameters. For example you can use this example below to both supply the API key and info.

https://api.nodehost.cloud/post_account_email_create?api_key=KEY&subject=Test&message=Hello&type=alert

CURL

curl --location --request GET 'https://api.nodehost.cloud/get_account_info'


GO Native

package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://api.nodehost.cloud/get_account_info"
method := "GET"

client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)

if err != nil {
fmt.Println(err)
}
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)

fmt.Println(string(body))
}



HTTP

GET /get_account_info HTTP/1.1
Host: api.nodehost.cloud


C Libcurl

CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.nodehost.cloud/get_account_info");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);



NodeJS Native

var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
'method': 'GET',
'hostname': 'api.nodehost.cloud',
'path': '/get_account_info',
'headers': {
},
'maxRedirects': 20
};

var req = https.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});

res.on("error", function (error) {
console.error(error);
});
});

req.end();



PHP cURL

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.nodehost.cloud/get_account_info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Was this article helpful?
Cancel
Thank you!