Copy to Clipboard CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "Authorization: <SOME_STRING_VALUE>");
headers = curl_slist_append(headers, "apikey: <SOME_STRING_VALUE>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd); Copy to Clipboard (require '[clj-http.client :as client])
(client/get "https://api.onegov.nsw.gov.au/propertyregister/v1/verify" {:headers {:content-type "application/json"
:Authorization "<SOME_STRING_VALUE>"
:apikey "<SOME_STRING_VALUE>"}
:query-params {:licenceNumber "10055055"}}) Copy to Clipboard require "http/client"
url = "https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055"
headers = HTTP::Headers{
"content-type" => "application/json"
"Authorization" => "<SOME_STRING_VALUE>"
"apikey" => "<SOME_STRING_VALUE>"
}
response = HTTP::Client.get url, headers: headers
puts response.body Copy to Clipboard using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055"),
Headers =
{
{ "Authorization", "<SOME_STRING_VALUE>" },
{ "apikey", "<SOME_STRING_VALUE>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
} Copy to Clipboard var client = new RestClient("https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055");
var request = new RestRequest("", Method.Get);
request.AddHeader("content-type", "application/json");
request.AddHeader("Authorization", "<SOME_STRING_VALUE>");
request.AddHeader("apikey", "<SOME_STRING_VALUE>");
var response = client.Execute(request); Copy to Clipboard package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("content-type", "application/json")
req.Header.Add("Authorization", "<SOME_STRING_VALUE>")
req.Header.Add("apikey", "<SOME_STRING_VALUE>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
} Copy to Clipboard GET /propertyregister/v1/verify?licenceNumber=10055055 HTTP/1.1
Content-Type: application/json
Authorization: <SOME_STRING_VALUE>
Apikey: <SOME_STRING_VALUE>
Host: api.onegov.nsw.gov.au
Copy to Clipboard AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055")
.setHeader("content-type", "application/json")
.setHeader("Authorization", "<SOME_STRING_VALUE>")
.setHeader("apikey", "<SOME_STRING_VALUE>")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close(); Copy to Clipboard HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055"))
.header("content-type", "application/json")
.header("Authorization", "<SOME_STRING_VALUE>")
.header("apikey", "<SOME_STRING_VALUE>")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body()); Copy to Clipboard OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055")
.get()
.addHeader("content-type", "application/json")
.addHeader("Authorization", "<SOME_STRING_VALUE>")
.addHeader("apikey", "<SOME_STRING_VALUE>")
.build();
Response response = client.newCall(request).execute(); Copy to Clipboard HttpResponse<String> response = Unirest.get("https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055")
.header("content-type", "application/json")
.header("Authorization", "<SOME_STRING_VALUE>")
.header("apikey", "<SOME_STRING_VALUE>")
.asString(); Copy to Clipboard const data = null;
const 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/propertyregister/v1/verify?licenceNumber=10055055');
xhr.setRequestHeader('content-type', 'application/json');
xhr.setRequestHeader('Authorization', '<SOME_STRING_VALUE>');
xhr.setRequestHeader('apikey', '<SOME_STRING_VALUE>');
xhr.send(data); Copy to Clipboard import axios from 'axios';
const options = {
method: 'GET',
url: 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify',
params: {licenceNumber: '10055055'},
headers: {
'content-type': 'application/json',
Authorization: '<SOME_STRING_VALUE>',
apikey: '<SOME_STRING_VALUE>'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
} Copy to Clipboard const url = 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055';
const options = {
method: 'GET',
headers: {
'content-type': 'application/json',
Authorization: '<SOME_STRING_VALUE>',
apikey: '<SOME_STRING_VALUE>'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
} Copy to Clipboard const settings = {
async: true,
crossDomain: true,
url: 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055',
method: 'GET',
headers: {
'content-type': 'application/json',
Authorization: '<SOME_STRING_VALUE>',
apikey: '<SOME_STRING_VALUE>'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
}); Copy to Clipboard val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055")
.get()
.addHeader("content-type", "application/json")
.addHeader("Authorization", "<SOME_STRING_VALUE>")
.addHeader("apikey", "<SOME_STRING_VALUE>")
.build()
val response = client.newCall(request).execute() Copy to Clipboard const http = require('https');
const options = {
method: 'GET',
hostname: 'api.onegov.nsw.gov.au',
port: null,
path: '/propertyregister/v1/verify?licenceNumber=10055055',
headers: {
'content-type': 'application/json',
Authorization: '<SOME_STRING_VALUE>',
apikey: '<SOME_STRING_VALUE>'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end(); Copy to Clipboard const request = require('request');
const options = {
method: 'GET',
url: 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify',
qs: {licenceNumber: '10055055'},
headers: {
'content-type': 'application/json',
Authorization: '<SOME_STRING_VALUE>',
apikey: '<SOME_STRING_VALUE>'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
}); Copy to Clipboard const unirest = require('unirest');
const req = unirest('GET', 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify');
req.query({
licenceNumber: '10055055'
});
req.headers({
'content-type': 'application/json',
Authorization: '<SOME_STRING_VALUE>',
apikey: '<SOME_STRING_VALUE>'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
}); Copy to Clipboard const axios = require('axios').default;
const options = {
method: 'GET',
url: 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify',
params: {licenceNumber: '10055055'},
headers: {
'content-type': 'application/json',
Authorization: '<SOME_STRING_VALUE>',
apikey: '<SOME_STRING_VALUE>'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
} Copy to Clipboard const fetch = require('node-fetch');
const url = 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055';
const options = {
method: 'GET',
headers: {
'content-type': 'application/json',
Authorization: '<SOME_STRING_VALUE>',
apikey: '<SOME_STRING_VALUE>'
}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
} Copy to Clipboard #import <Foundation/Foundation.h>
NSDictionary *headers = @{ @"content-type": @"application/json",
@"Authorization": @"<SOME_STRING_VALUE>",
@"apikey": @"<SOME_STRING_VALUE>" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055"]
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]; Copy to Clipboard open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055" in
let headers = Header.add_list (Header.init ()) [
("content-type", "application/json");
("Authorization", "<SOME_STRING_VALUE>");
("apikey", "<SOME_STRING_VALUE>");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *) Copy to Clipboard <?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <SOME_STRING_VALUE>",
"apikey: <SOME_STRING_VALUE>",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
} Copy to Clipboard <?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055', [
'headers' => [
'Authorization' => '<SOME_STRING_VALUE>',
'apikey' => '<SOME_STRING_VALUE>',
'content-type' => 'application/json',
],
]);
echo $response->getBody(); Copy to Clipboard <?php
$request = new HttpRequest();
$request->setUrl('https://api.onegov.nsw.gov.au/propertyregister/v1/verify');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'licenceNumber' => '10055055'
]);
$request->setHeaders([
'content-type' => 'application/json',
'Authorization' => '<SOME_STRING_VALUE>',
'apikey' => '<SOME_STRING_VALUE>'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
} Copy to Clipboard <?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.onegov.nsw.gov.au/propertyregister/v1/verify');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'licenceNumber' => '10055055'
]));
$request->setHeaders([
'content-type' => 'application/json',
'Authorization' => '<SOME_STRING_VALUE>',
'apikey' => '<SOME_STRING_VALUE>'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody(); Copy to Clipboard $headers=@{}
$headers.Add("content-type", "application/json")
$headers.Add("Authorization", "<SOME_STRING_VALUE>")
$headers.Add("apikey", "<SOME_STRING_VALUE>")
$response = Invoke-WebRequest -Uri 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055' -Method GET -Headers $headers Copy to Clipboard $headers=@{}
$headers.Add("content-type", "application/json")
$headers.Add("Authorization", "<SOME_STRING_VALUE>")
$headers.Add("apikey", "<SOME_STRING_VALUE>")
$response = Invoke-RestMethod -Uri 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055' -Method GET -Headers $headers Copy to Clipboard import http.client
conn = http.client.HTTPSConnection("api.onegov.nsw.gov.au")
headers = {
'content-type': "application/json",
'Authorization': "<SOME_STRING_VALUE>",
'apikey': "<SOME_STRING_VALUE>"
}
conn.request("GET", "/propertyregister/v1/verify?licenceNumber=10055055", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8")) Copy to Clipboard import requests
url = "https://api.onegov.nsw.gov.au/propertyregister/v1/verify"
querystring = {"licenceNumber":"10055055"}
headers = {
"content-type": "application/json",
"Authorization": "<SOME_STRING_VALUE>",
"apikey": "<SOME_STRING_VALUE>"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json()) Copy to Clipboard library(httr)
url <- "https://api.onegov.nsw.gov.au/propertyregister/v1/verify"
queryString <- list(licenceNumber = "10055055")
response <- VERB("GET", url, query = queryString, add_headers('Authorization' = '<SOME_STRING_VALUE>', 'apikey' = '<SOME_STRING_VALUE>'), content_type("application/octet-stream"))
content(response, "text") Copy to Clipboard require 'uri'
require 'net/http'
url = URI("https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
request["Authorization"] = '<SOME_STRING_VALUE>'
request["apikey"] = '<SOME_STRING_VALUE>'
response = http.request(request)
puts response.read_body Copy to Clipboard require 'faraday'
conn = Faraday.new(
url: 'https://api.onegov.nsw.gov.au',
headers: {'Content-Type' => 'application/json'}
)
response = conn.get('/propertyregister/v1/verify') do |req|
req.headers['Authorization'] = '<SOME_STRING_VALUE>'
req.headers['apikey'] = '<SOME_STRING_VALUE>'
req.params['licenceNumber'] = '10055055'
end
puts response.status
puts response.body Copy to Clipboard use reqwest;
#[tokio::main]
pub async fn main() {
let url = "https://api.onegov.nsw.gov.au/propertyregister/v1/verify";
let querystring = [
("licenceNumber", "10055055"),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
headers.insert("Authorization", "<SOME_STRING_VALUE>".parse().unwrap());
headers.insert("apikey", "<SOME_STRING_VALUE>".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::<serde_json::Value>()
.await
.unwrap();
dbg!(results);
}
Copy to Clipboard curl --request GET \
--url 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055' \
--header 'Authorization: <SOME_STRING_VALUE>' \
--header 'apikey: <SOME_STRING_VALUE>' \
--header 'content-type: application/json' Copy to Clipboard http GET 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055' \
Authorization:'<SOME_STRING_VALUE>' \
apikey:'<SOME_STRING_VALUE>' \
content-type:application/json Copy to Clipboard wget --quiet \
--method GET \
--header 'content-type: application/json' \
--header 'Authorization: <SOME_STRING_VALUE>' \
--header 'apikey: <SOME_STRING_VALUE>' \
--output-document \
- 'https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055' Copy to Clipboard import Foundation
let headers = [
"content-type": "application/json",
"Authorization": "<SOME_STRING_VALUE>",
"apikey": "<SOME_STRING_VALUE>"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://api.onegov.nsw.gov.au/propertyregister/v1/verify?licenceNumber=10055055")! 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 as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()