CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: <SOME_STRING_VALUE>");
headers = curl_slist_append(headers, "authorization: <SOME_STRING_VALUE>");
headers = curl_slist_append(headers, "apikey: <SOME_STRING_VALUE>");
headers = curl_slist_append(headers, "transactionid: <SOME_STRING_VALUE>");
headers = curl_slist_append(headers, "requesttimestamp: <SOME_STRING_VALUE>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices" {:headers {:content-type "<SOME_STRING_VALUE>"
:authorization "<SOME_STRING_VALUE>"
:apikey "<SOME_STRING_VALUE>"
:transactionid "<SOME_STRING_VALUE>"
:requesttimestamp "<SOME_STRING_VALUE>"}})
var client = new RestClient("https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices");
var request = new RestRequest(Method.GET);
request.AddHeader("content-type", "<SOME_STRING_VALUE>");
request.AddHeader("authorization", "<SOME_STRING_VALUE>");
request.AddHeader("apikey", "<SOME_STRING_VALUE>");
request.AddHeader("transactionid", "<SOME_STRING_VALUE>");
request.AddHeader("requesttimestamp", "<SOME_STRING_VALUE>");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("content-type", "<SOME_STRING_VALUE>")
req.Header.Add("authorization", "<SOME_STRING_VALUE>")
req.Header.Add("apikey", "<SOME_STRING_VALUE>")
req.Header.Add("transactionid", "<SOME_STRING_VALUE>")
req.Header.Add("requesttimestamp", "<SOME_STRING_VALUE>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /FuelPriceCheck/v1/fuel/prices HTTP/1.1
Content-Type: <SOME_STRING_VALUE>
Authorization: <SOME_STRING_VALUE>
Apikey: <SOME_STRING_VALUE>
Transactionid: <SOME_STRING_VALUE>
Requesttimestamp: <SOME_STRING_VALUE>
Host: api.onegov.nsw.gov.au
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices")
.get()
.addHeader("content-type", "<SOME_STRING_VALUE>")
.addHeader("authorization", "<SOME_STRING_VALUE>")
.addHeader("apikey", "<SOME_STRING_VALUE>")
.addHeader("transactionid", "<SOME_STRING_VALUE>")
.addHeader("requesttimestamp", "<SOME_STRING_VALUE>")
.build();
Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.get("https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices")
.header("content-type", "<SOME_STRING_VALUE>")
.header("authorization", "<SOME_STRING_VALUE>")
.header("apikey", "<SOME_STRING_VALUE>")
.header("transactionid", "<SOME_STRING_VALUE>")
.header("requesttimestamp", "<SOME_STRING_VALUE>")
.asString();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices",
"method": "GET",
"headers": {
"content-type": "<SOME_STRING_VALUE>",
"authorization": "<SOME_STRING_VALUE>",
"apikey": "<SOME_STRING_VALUE>",
"transactionid": "<SOME_STRING_VALUE>",
"requesttimestamp": "<SOME_STRING_VALUE>"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
fetch("https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices", {
"method": "GET",
"headers": {
"content-type": "<SOME_STRING_VALUE>",
"authorization": "<SOME_STRING_VALUE>",
"apikey": "<SOME_STRING_VALUE>",
"transactionid": "<SOME_STRING_VALUE>",
"requesttimestamp": "<SOME_STRING_VALUE>"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});
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("GET", "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices");
xhr.setRequestHeader("content-type", "<SOME_STRING_VALUE>");
xhr.setRequestHeader("authorization", "<SOME_STRING_VALUE>");
xhr.setRequestHeader("apikey", "<SOME_STRING_VALUE>");
xhr.setRequestHeader("transactionid", "<SOME_STRING_VALUE>");
xhr.setRequestHeader("requesttimestamp", "<SOME_STRING_VALUE>");
xhr.send(data);
var http = require("https");
var options = {
"method": "GET",
"hostname": "api.onegov.nsw.gov.au",
"port": null,
"path": "/FuelPriceCheck/v1/fuel/prices",
"headers": {
"content-type": "<SOME_STRING_VALUE>",
"authorization": "<SOME_STRING_VALUE>",
"apikey": "<SOME_STRING_VALUE>",
"transactionid": "<SOME_STRING_VALUE>",
"requesttimestamp": "<SOME_STRING_VALUE>"
}
};
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: 'GET',
url: 'https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices',
headers: {
'content-type': '<SOME_STRING_VALUE>',
authorization: '<SOME_STRING_VALUE>',
apikey: '<SOME_STRING_VALUE>',
transactionid: '<SOME_STRING_VALUE>',
requesttimestamp: '<SOME_STRING_VALUE>'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
var unirest = require("unirest");
var req = unirest("GET", "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices");
req.headers({
"content-type": "<SOME_STRING_VALUE>",
"authorization": "<SOME_STRING_VALUE>",
"apikey": "<SOME_STRING_VALUE>",
"transactionid": "<SOME_STRING_VALUE>",
"requesttimestamp": "<SOME_STRING_VALUE>"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
#import <Foundation/Foundation.h>
NSDictionary *headers = @{ @"content-type": @"<SOME_STRING_VALUE>",
@"authorization": @"<SOME_STRING_VALUE>",
@"apikey": @"<SOME_STRING_VALUE>",
@"transactionid": @"<SOME_STRING_VALUE>",
@"requesttimestamp": @"<SOME_STRING_VALUE>" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices" in
let headers = Header.add_list (Header.init ()) [
("content-type", "<SOME_STRING_VALUE>");
("authorization", "<SOME_STRING_VALUE>");
("apikey", "<SOME_STRING_VALUE>");
("transactionid", "<SOME_STRING_VALUE>");
("requesttimestamp", "<SOME_STRING_VALUE>");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"apikey: <SOME_STRING_VALUE>",
"authorization: <SOME_STRING_VALUE>",
"content-type: <SOME_STRING_VALUE>",
"requesttimestamp: <SOME_STRING_VALUE>",
"transactionid: <SOME_STRING_VALUE>"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
<?php
$request = new HttpRequest();
$request->setUrl('https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'content-type' => '<SOME_STRING_VALUE>',
'authorization' => '<SOME_STRING_VALUE>',
'apikey' => '<SOME_STRING_VALUE>',
'transactionid' => '<SOME_STRING_VALUE>',
'requesttimestamp' => '<SOME_STRING_VALUE>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices');
$request->setRequestMethod('GET');
$request->setHeaders(array(
'content-type' => '<SOME_STRING_VALUE>',
'authorization' => '<SOME_STRING_VALUE>',
'apikey' => '<SOME_STRING_VALUE>',
'transactionid' => '<SOME_STRING_VALUE>',
'requesttimestamp' => '<SOME_STRING_VALUE>'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "<SOME_STRING_VALUE>")
$headers.Add("authorization", "<SOME_STRING_VALUE>")
$headers.Add("apikey", "<SOME_STRING_VALUE>")
$headers.Add("transactionid", "<SOME_STRING_VALUE>")
$headers.Add("requesttimestamp", "<SOME_STRING_VALUE>")
$response = Invoke-WebRequest -Uri 'https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices' -Method GET -Headers $headers
$headers=@{}
$headers.Add("content-type", "<SOME_STRING_VALUE>")
$headers.Add("authorization", "<SOME_STRING_VALUE>")
$headers.Add("apikey", "<SOME_STRING_VALUE>")
$headers.Add("transactionid", "<SOME_STRING_VALUE>")
$headers.Add("requesttimestamp", "<SOME_STRING_VALUE>")
$response = Invoke-RestMethod -Uri 'https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("api.onegov.nsw.gov.au")
headers = {
'content-type': "<SOME_STRING_VALUE>",
'authorization': "<SOME_STRING_VALUE>",
'apikey': "<SOME_STRING_VALUE>",
'transactionid': "<SOME_STRING_VALUE>",
'requesttimestamp': "<SOME_STRING_VALUE>"
}
conn.request("GET", "/FuelPriceCheck/v1/fuel/prices", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices"
headers = {
'content-type': "<SOME_STRING_VALUE>",
'authorization': "<SOME_STRING_VALUE>",
'apikey': "<SOME_STRING_VALUE>",
'transactionid': "<SOME_STRING_VALUE>",
'requesttimestamp': "<SOME_STRING_VALUE>"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["content-type"] = '<SOME_STRING_VALUE>'
request["authorization"] = '<SOME_STRING_VALUE>'
request["apikey"] = '<SOME_STRING_VALUE>'
request["transactionid"] = '<SOME_STRING_VALUE>'
request["requesttimestamp"] = '<SOME_STRING_VALUE>'
response = http.request(request)
puts response.read_body
curl --request GET \
--url https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices \
--header 'apikey: <SOME_STRING_VALUE>' \
--header 'authorization: <SOME_STRING_VALUE>' \
--header 'content-type: <SOME_STRING_VALUE>' \
--header 'requesttimestamp: <SOME_STRING_VALUE>' \
--header 'transactionid: <SOME_STRING_VALUE>'
http GET https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices \
apikey:'<SOME_STRING_VALUE>' \
authorization:'<SOME_STRING_VALUE>' \
content-type:'<SOME_STRING_VALUE>' \
requesttimestamp:'<SOME_STRING_VALUE>' \
transactionid:'<SOME_STRING_VALUE>'
wget --quiet \
--method GET \
--header 'content-type: <SOME_STRING_VALUE>' \
--header 'authorization: <SOME_STRING_VALUE>' \
--header 'apikey: <SOME_STRING_VALUE>' \
--header 'transactionid: <SOME_STRING_VALUE>' \
--header 'requesttimestamp: <SOME_STRING_VALUE>' \
--output-document \
- https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices
import Foundation
let headers = [
"content-type": "<SOME_STRING_VALUE>",
"authorization": "<SOME_STRING_VALUE>",
"apikey": "<SOME_STRING_VALUE>",
"transactionid": "<SOME_STRING_VALUE>",
"requesttimestamp": "<SOME_STRING_VALUE>"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices")! 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()