CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://account.idevaffiliate.com/API/rest-api/getCommissions.php?commission_type=pending_approval");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "authorization: Bearer (Token in response of authenticate / login request)");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://account.idevaffiliate.com/API/rest-api/getCommissions.php?commission_type=pending_approval");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Bearer (Token in response of authenticate / login request)");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://account.idevaffiliate.com/API/rest-api/getCommissions.php?commission_type=pending_approval"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "Bearer (Token in response of authenticate / login request)")
req.Header.Add("cache-control", "no-cache")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://account.idevaffiliate.com/API/rest-api/getCommissions.php?commission_type=pending_approval")
.get()
.addHeader("authorization", "Bearer (Token in response of authenticate / login request)")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var http = require("http");
var options = {
"method": "GET",
"hostname": "idevtest.com",
"port": null,
"path": "/ninetwo/API/rest-api/getCommissions.php?commission_type=pending_approval",
"headers": {
"authorization": "Bearer (Token in response of authenticate / login request)",
"cache-control": "no-cache"
}
};
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();
<?php
var http = require("http");
var options = {
"method": "GET",
"hostname": "idevtest.com",
"port": null,
"path": "/ninetwo/API/rest-api/getCommissions.php?commission_type=pending_approval",
"headers": {
"authorization": "Bearer (Token in response of authenticate / login request)",
"cache-control": "no-cache"
}
};
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();
import http.client
conn = http.client.HTTPConnection("idevtest.com")
headers = {
'authorization': "Bearer (Token in response of authenticate / login request)",
'cache-control': "no-cache"
}
conn.request("GET", "/ninetwo/API/rest-api/getCommissions.php?commission_type=pending_approval", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://account.idevaffiliate.com/API/rest-api/getCommissions.php?commission_type=pending_approval")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer (Token in response of authenticate / login request)'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import Foundation
let headers = [
"authorization": "Bearer (Token in response of authenticate / login request)",
"cache-control": "no-cache"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://account.idevaffiliate.com/API/rest-api/getCommissions.php?commission_type=pending_approval")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()