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/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E");
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/ownerbuilder/v1/browse" {:headers {:content-type "application/json"
:authorization "<SOME_STRING_VALUE>"
:apikey "<SOME_STRING_VALUE>"}
:query-params {:searchText "<SOME_STRING_VALUE>"}})
Copy to Clipboard var client = new RestClient("https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E");
var request = new RestRequest(Method.GET);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "<SOME_STRING_VALUE>");
request.AddHeader("apikey", "<SOME_STRING_VALUE>");
IRestResponse response = client.Execute(request);
Copy to Clipboard package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E"
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, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Copy to Clipboard GET /ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E HTTP/1.1
Content-Type: application/json
Authorization: <SOME_STRING_VALUE>
Apikey: <SOME_STRING_VALUE>
Host: api.onegov.nsw.gov.au
Copy to Clipboard OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E")
.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/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E")
.header("content-type", "application/json")
.header("authorization", "<SOME_STRING_VALUE>")
.header("apikey", "<SOME_STRING_VALUE>")
.asString();
Copy to Clipboard var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E",
"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 fetch("https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E", {
"method": "GET",
"headers": {
"content-type": "application/json",
"authorization": "<SOME_STRING_VALUE>",
"apikey": "<SOME_STRING_VALUE>"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});
Copy to Clipboard 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/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "<SOME_STRING_VALUE>");
xhr.setRequestHeader("apikey", "<SOME_STRING_VALUE>");
xhr.send(data);
Copy to Clipboard var http = require("https");
var options = {
"method": "GET",
"hostname": "api.onegov.nsw.gov.au",
"port": null,
"path": "/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E",
"headers": {
"content-type": "application/json",
"authorization": "<SOME_STRING_VALUE>",
"apikey": "<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();
Copy to Clipboard var request = require("request");
var options = {
method: 'GET',
url: 'https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse',
qs: {searchText: '<SOME_STRING_VALUE>'},
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 var unirest = require("unirest");
var req = unirest("GET", "https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse");
req.query({
"searchText": "<SOME_STRING_VALUE>"
});
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 #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/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E"]
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/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E" 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, array(
CURLOPT_URL => "https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E",
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: 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
$request = new HttpRequest();
$request->setUrl('https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'searchText' => '<SOME_STRING_VALUE>'
));
$request->setHeaders(array(
'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/ownerbuilder/v1/browse');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString(array(
'searchText' => '<SOME_STRING_VALUE>'
)));
$request->setHeaders(array(
'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/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E' -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/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E' -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", "/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E", 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/ownerbuilder/v1/browse"
querystring = {"searchText":"<SOME_STRING_VALUE>"}
headers = {
'content-type': "application/json",
'authorization': "<SOME_STRING_VALUE>",
'apikey': "<SOME_STRING_VALUE>"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
Copy to Clipboard require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E")
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"] = 'application/json'
request["authorization"] = '<SOME_STRING_VALUE>'
request["apikey"] = '<SOME_STRING_VALUE>'
response = http.request(request)
puts response.read_body
Copy to Clipboard curl --request GET \
--url 'https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E' \
--header 'apikey: <SOME_STRING_VALUE>' \
--header 'authorization: <SOME_STRING_VALUE>' \
--header 'content-type: application/json'
Copy to Clipboard http GET 'https://api.onegov.nsw.gov.au/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E' \
apikey:'<SOME_STRING_VALUE>' \
authorization:'<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/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E'
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/ownerbuilder/v1/browse?searchText=%3CSOME_STRING_VALUE%3E")! 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()