GET Convert a given number from one base to another base
{{baseUrl}}/numbers/base
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
QUERY PARAMS

number
to
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/base?number=&to=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/base" {:headers {:x-mathtools-api-secret "{{apiKey}}"}
                                                        :query-params {:number ""
                                                                       :to ""}})
require "http/client"

url = "{{baseUrl}}/numbers/base?number=&to="
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/base?number=&to="),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/base?number=&to=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/base?number=&to="

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/base?number=&to= HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/base?number=&to=")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/base?number=&to="))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/base?number=&to=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/base?number=&to=")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/base?number=&to=');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base',
  params: {number: '', to: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/base?number=&to=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/base?number=&to=',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/base?number=&to=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/base?number=&to=',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base',
  qs: {number: '', to: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/base');

req.query({
  number: '',
  to: ''
});

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base',
  params: {number: '', to: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/base?number=&to=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/base?number=&to="]
                                                       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 "{{baseUrl}}/numbers/base?number=&to=" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/base?number=&to=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/base?number=&to=', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/base');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData([
  'number' => '',
  'to' => ''
]);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/base');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'number' => '',
  'to' => ''
]));

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/base?number=&to=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/base?number=&to=' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/base?number=&to=", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/base"

querystring = {"number":"","to":""}

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/base"

queryString <- list(
  number = "",
  to = ""
)

response <- VERB("GET", url, query = queryString, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/base?number=&to=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/base') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
  req.params['number'] = ''
  req.params['to'] = ''
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/base";

    let querystring = [
        ("number", ""),
        ("to", ""),
    ];

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .query(&querystring)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url '{{baseUrl}}/numbers/base?number=&to=' \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET '{{baseUrl}}/numbers/base?number=&to=' \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - '{{baseUrl}}/numbers/base?number=&to='
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/base?number=&to=")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 32,
    "base": {
      "from": 10,
      "to": 2
    },
    "answer": "100000"
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Convert a given number to binary
{{baseUrl}}/numbers/base/binary
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
QUERY PARAMS

number
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/base/binary?number=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/base/binary" {:headers {:x-mathtools-api-secret "{{apiKey}}"}
                                                               :query-params {:number ""}})
require "http/client"

url = "{{baseUrl}}/numbers/base/binary?number="
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/base/binary?number="),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/base/binary?number=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/base/binary?number="

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/base/binary?number= HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/base/binary?number=")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/base/binary?number="))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/base/binary?number=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/base/binary?number=")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/base/binary?number=');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base/binary',
  params: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/base/binary?number=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/base/binary?number=',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/base/binary?number=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/base/binary?number=',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base/binary',
  qs: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/base/binary');

req.query({
  number: ''
});

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base/binary',
  params: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/base/binary?number=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/base/binary?number="]
                                                       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 "{{baseUrl}}/numbers/base/binary?number=" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/base/binary?number=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/base/binary?number=', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/base/binary');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData([
  'number' => ''
]);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/base/binary');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'number' => ''
]));

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/base/binary?number=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/base/binary?number=' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/base/binary?number=", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/base/binary"

querystring = {"number":""}

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/base/binary"

queryString <- list(number = "")

response <- VERB("GET", url, query = queryString, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/base/binary?number=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/base/binary') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
  req.params['number'] = ''
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/base/binary";

    let querystring = [
        ("number", ""),
    ];

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .query(&querystring)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url '{{baseUrl}}/numbers/base/binary?number=' \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET '{{baseUrl}}/numbers/base/binary?number=' \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - '{{baseUrl}}/numbers/base/binary?number='
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/base/binary?number=")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 32,
    "base": {
      "from": 10,
      "to": 2
    },
    "answer": "100000"
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                    
GET Convert a given number to hexadecimal
{{baseUrl}}/numbers/base/hex
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
QUERY PARAMS

number
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/base/hex?number=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/base/hex" {:headers {:x-mathtools-api-secret "{{apiKey}}"}
                                                            :query-params {:number ""}})
require "http/client"

url = "{{baseUrl}}/numbers/base/hex?number="
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/base/hex?number="),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/base/hex?number=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/base/hex?number="

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/base/hex?number= HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/base/hex?number=")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/base/hex?number="))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/base/hex?number=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/base/hex?number=")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/base/hex?number=');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base/hex',
  params: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/base/hex?number=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/base/hex?number=',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/base/hex?number=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/base/hex?number=',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base/hex',
  qs: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/base/hex');

req.query({
  number: ''
});

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base/hex',
  params: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/base/hex?number=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/base/hex?number="]
                                                       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 "{{baseUrl}}/numbers/base/hex?number=" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/base/hex?number=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/base/hex?number=', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/base/hex');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData([
  'number' => ''
]);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/base/hex');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'number' => ''
]));

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/base/hex?number=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/base/hex?number=' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/base/hex?number=", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/base/hex"

querystring = {"number":""}

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/base/hex"

queryString <- list(number = "")

response <- VERB("GET", url, query = queryString, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/base/hex?number=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/base/hex') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
  req.params['number'] = ''
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/base/hex";

    let querystring = [
        ("number", ""),
    ];

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .query(&querystring)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url '{{baseUrl}}/numbers/base/hex?number=' \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET '{{baseUrl}}/numbers/base/hex?number=' \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - '{{baseUrl}}/numbers/base/hex?number='
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/base/hex?number=")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 78,
    "base": {
      "from": 10,
      "to": 16
    },
    "answer": "4e"
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                          
GET Convert a given number to octal
{{baseUrl}}/numbers/base/octal
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
QUERY PARAMS

number
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/base/octal?number=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/base/octal" {:headers {:x-mathtools-api-secret "{{apiKey}}"}
                                                              :query-params {:number ""}})
require "http/client"

url = "{{baseUrl}}/numbers/base/octal?number="
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/base/octal?number="),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/base/octal?number=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/base/octal?number="

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/base/octal?number= HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/base/octal?number=")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/base/octal?number="))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/base/octal?number=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/base/octal?number=")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/base/octal?number=');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base/octal',
  params: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/base/octal?number=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/base/octal?number=',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/base/octal?number=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/base/octal?number=',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base/octal',
  qs: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/base/octal');

req.query({
  number: ''
});

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/base/octal',
  params: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/base/octal?number=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/base/octal?number="]
                                                       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 "{{baseUrl}}/numbers/base/octal?number=" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/base/octal?number=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/base/octal?number=', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/base/octal');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData([
  'number' => ''
]);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/base/octal');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'number' => ''
]));

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/base/octal?number=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/base/octal?number=' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/base/octal?number=", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/base/octal"

querystring = {"number":""}

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/base/octal"

queryString <- list(number = "")

response <- VERB("GET", url, query = queryString, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/base/octal?number=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/base/octal') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
  req.params['number'] = ''
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/base/octal";

    let querystring = [
        ("number", ""),
    ];

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .query(&querystring)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url '{{baseUrl}}/numbers/base/octal?number=' \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET '{{baseUrl}}/numbers/base/octal?number=' \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - '{{baseUrl}}/numbers/base/octal?number='
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/base/octal?number=")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 78,
    "base": {
      "from": 10,
      "to": 8
    },
    "answer": "116"
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}  
GET Checks whether a given number is a cube number or not.
{{baseUrl}}/numbers/is-cube
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/is-cube");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/is-cube" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/is-cube"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/is-cube"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/is-cube");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/is-cube"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/is-cube HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/is-cube")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/is-cube"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/is-cube")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/is-cube")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/is-cube');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-cube',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/is-cube';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/is-cube',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/is-cube")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/is-cube',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-cube',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/is-cube');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-cube',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/is-cube';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/is-cube"]
                                                       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 "{{baseUrl}}/numbers/is-cube" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/is-cube",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/is-cube', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/is-cube');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/is-cube');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/is-cube' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/is-cube' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/is-cube", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/is-cube"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/is-cube"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/is-cube")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/is-cube') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/is-cube";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/is-cube \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/is-cube \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/is-cube
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/is-cube")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 27,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}       
GET Checks whether a given number is a palindrome number or not.
{{baseUrl}}/numbers/is-palindrome
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/is-palindrome");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/is-palindrome" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/is-palindrome"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/is-palindrome"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/is-palindrome");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/is-palindrome"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/is-palindrome HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/is-palindrome")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/is-palindrome"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/is-palindrome")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/is-palindrome")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/is-palindrome');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-palindrome',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/is-palindrome';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/is-palindrome',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/is-palindrome")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/is-palindrome',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-palindrome',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/is-palindrome');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-palindrome',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/is-palindrome';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/is-palindrome"]
                                                       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 "{{baseUrl}}/numbers/is-palindrome" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/is-palindrome",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/is-palindrome', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/is-palindrome');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/is-palindrome');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/is-palindrome' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/is-palindrome' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/is-palindrome", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/is-palindrome"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/is-palindrome"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/is-palindrome")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/is-palindrome') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/is-palindrome";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/is-palindrome \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/is-palindrome \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/is-palindrome
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/is-palindrome")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 456654,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}               
GET Checks whether a given number is a square number or not.
{{baseUrl}}/numbers/is-square
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/is-square");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/is-square" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/is-square"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/is-square"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/is-square");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/is-square"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/is-square HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/is-square")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/is-square"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/is-square")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/is-square")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/is-square');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-square',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/is-square';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/is-square',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/is-square")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/is-square',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-square',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/is-square');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-square',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/is-square';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/is-square"]
                                                       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 "{{baseUrl}}/numbers/is-square" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/is-square",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/is-square', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/is-square');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/is-square');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/is-square' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/is-square' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/is-square", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/is-square"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/is-square"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/is-square")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/is-square') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/is-square";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/is-square \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/is-square \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/is-square
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/is-square")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 16,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                                          
GET Checks whether a given number is a triangle number or not.
{{baseUrl}}/numbers/is-triangle
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/is-triangle");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/is-triangle" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/is-triangle"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/is-triangle"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/is-triangle");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/is-triangle"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/is-triangle HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/is-triangle")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/is-triangle"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/is-triangle")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/is-triangle")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/is-triangle');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-triangle',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/is-triangle';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/is-triangle',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/is-triangle")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/is-triangle',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-triangle',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/is-triangle');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/is-triangle',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/is-triangle';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/is-triangle"]
                                                       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 "{{baseUrl}}/numbers/is-triangle" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/is-triangle",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/is-triangle', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/is-triangle');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/is-triangle');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/is-triangle' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/is-triangle' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/is-triangle", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/is-triangle"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/is-triangle"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/is-triangle")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/is-triangle') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/is-triangle";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/is-triangle \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/is-triangle \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/is-triangle
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/is-triangle")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 45,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}  
GET Get a random fact about a number
{{baseUrl}}/numbers/fact
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
QUERY PARAMS

number
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/fact?number=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/fact" {:headers {:x-mathtools-api-secret "{{apiKey}}"}
                                                        :query-params {:number ""}})
require "http/client"

url = "{{baseUrl}}/numbers/fact?number="
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/fact?number="),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/fact?number=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/fact?number="

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/fact?number= HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/fact?number=")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/fact?number="))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/fact?number=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/fact?number=")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/fact?number=');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/fact',
  params: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/fact?number=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/fact?number=',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/fact?number=")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/fact?number=',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/fact',
  qs: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/fact');

req.query({
  number: ''
});

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/fact',
  params: {number: ''},
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/fact?number=';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/fact?number="]
                                                       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 "{{baseUrl}}/numbers/fact?number=" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/fact?number=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/fact?number=', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/fact');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData([
  'number' => ''
]);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/fact');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'number' => ''
]));

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/fact?number=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/fact?number=' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/fact?number=", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/fact"

querystring = {"number":""}

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/fact"

queryString <- list(number = "")

response <- VERB("GET", url, query = queryString, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/fact?number=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/fact') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
  req.params['number'] = ''
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/fact";

    let querystring = [
        ("number", ""),
    ];

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .query(&querystring)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url '{{baseUrl}}/numbers/fact?number=' \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET '{{baseUrl}}/numbers/fact?number=' \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - '{{baseUrl}}/numbers/fact?number='
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/fact?number=")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 11,
    "fact": "11 is the largest known multiplicative persistence."
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                    
GET Generate random number(s)
{{baseUrl}}/numbers/random
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/random");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/random" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/random"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/random"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/random");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/random"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/random HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/random")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/random"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/random")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/random")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/random');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/random',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/random';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/random',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/random")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/random',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/random',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/random');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/random',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/random';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/random"]
                                                       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 "{{baseUrl}}/numbers/random" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/random",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/random', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/random');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/random');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/random' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/random' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/random", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/random"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/random"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/random")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/random') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/random";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/random \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/random \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/random
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/random")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "numbers": [
      1942400822,
      828097719,
      1581110549,
      1957713319,
      1920104909
    ],
    "min": 1,
    "max": 2147483647,
    "requested": 5,
    "returned": 5
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                    
GET Get the number of the day for current day
{{baseUrl}}/numbers/nod
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/nod");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/nod" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/nod"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/nod"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/nod");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/nod"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/nod HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/nod")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/nod"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/nod")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/nod")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/nod');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/nod',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/nod';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/nod',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/nod")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/nod',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/nod',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/nod');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/nod',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/nod';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/nod"]
                                                       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 "{{baseUrl}}/numbers/nod" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/nod",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/nod', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/nod');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/nod');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/nod' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/nod' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/nod", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/nod"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/nod"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/nod")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/nod') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/nod";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/nod \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/nod \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/nod
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/nod")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "nod": {
      "category": {
        "name": "nod",
        "description": "Number of the day.",
        "background": ""
      },
      "numbers": {
        "number": "56006",
        "uuid": "56006",
        "id": "56006",
        "names": {
          "nominal": {
            "name": "nominal",
            "description": "Nominal",
            "value": "56006",
            "display": "56006"
          },
          "cardinal": {
            "name": "cardinal",
            "description": "Cardinal",
            "value": "fifty-six thousand six",
            "display": "fifty-six thousand six"
          },
          "ordinal": {
            "name": "ordinal",
            "description": "Ordinal",
            "value": "56,006th",
            "display": "56,006th"
          },
          "us_currency": {
            "name": "us_currency",
            "description": "This number as US currency",
            "value": "fifty-six thousand six dollars",
            "display": "fifty-six thousand six dollars"
          }
        },
        "bases": {
          "binary": {
            "name": "binary",
            "description": "Base 2 (Binary)",
            "value": "1101101011000110",
            "display": "11011010110001102"
          },
          "ternary": {
            "name": "ternary",
            "description": "Base 3 (Ternary)",
            "value": "2211211022",
            "display": "22112110223"
          },
          "quaternary": {
            "name": "quaternary",
            "description": "Base 4 (Quaternary)",
            "value": "31223012",
            "display": "312230124"
          },
          "quinary": {
            "name": "quinary",
            "description": "Base 5 (Quinary)",
            "value": "3243011",
            "display": "32430115"
          },
          "senary": {
            "name": "senary",
            "description": "Base 6 (Senary)",
            "value": "1111142",
            "display": "11111426"
          },
          "octal": {
            "name": "octal",
            "description": "Base 8 (Octal)",
            "value": "155306",
            "display": "1553068"
          },
          "duodecimal": {
            "name": "duodecimal",
            "description": "Base 12 (Duodecimal)",
            "value": "284B2",
            "display": "284B212"
          },
          "hexadecimal": {
            "name": "vexadecimal",
            "description": "Base 16 (Hexadecimal)",
            "value": "DAC6",
            "display": "DAC616"
          },
          "vigesimal": {
            "name": "vigesimal",
            "description": "Base 20 (Vigesimal)",
            "value": "7006",
            "display": "700620"
          }
        },
        "numerals": {
          "roman": {
            "name": "roman",
            "description": "56006 in Roman Numeral",
            "value": "LVMVI",
            "display": "LVMVI"
          },
          "chinese": {
            "name": "chinese",
            "description": "56006 in Chinese Numeral",
            "value": "伍萬陸仟陸",
            "display": "伍萬陸仟陸"
          },
          "egyptian": {
            "name": "egyptian",
            "description": "56006 in Egyptian Numeral",
            "value": "𓂱𓇁𓏿",
            "display": "𓂱𓇁𓏿"
          },
          "babylonian": {
            "name": "babylonian",
            "description": "56006 in Babylonian Numeral",
            "value": "\"15\"   \"33\"   \"26\"   ",
            "display": "\"15\"   \"33\"   \"26\"   "
          }
        },
        "general-facts": {
          "odd": {
            "name": "odd",
            "description": "Is 56006 an odd number?",
            "value": false,
            "display": "56006 is NOT an odd number"
          },
          "even": {
            "name": "even",
            "description": "Is 56006 an even number?",
            "value": true,
            "display": "56006 is  an even number"
          },
          "palindrome": {
            "name": "palindrome",
            "description": "Is 56006 a palindrome?",
            "value": false,
            "display": "56006 is  NOT a palindrome number"
          },
          "triangle": {
            "name": "triangle",
            "description": "Is 56006 a triangle number?",
            "value": false,
            "display": "56006 is  NOT a triangle number"
          }
        },
        "prime-facts": {
          "prime": {
            "name": "prime",
            "description": "Is 56006 a Prime Number?",
            "value": false,
            "display": "56006 is NOT a  prime"
          },
          "perfect": {
            "name": "perfect",
            "description": "Is 56006 a perfect number?",
            "value": false,
            "display": "56006 is NOT a perfect number"
          },
          "mersenne": {
            "name": "mersenne",
            "description": "Is 56006 a Mersenne Prime?",
            "value": false,
            "display": "56006 is NOT a Mersenne prime"
          },
          "fermat": {
            "name": "fermat",
            "description": "Is 56006 a Fermat Prime?",
            "value": false,
            "display": "56006 is NOT a Fermat prime"
          },
          "fibonacci": {
            "name": "fibonacci",
            "description": "Is 56006 a Fibonacci Prime?",
            "value": false,
            "display": "56006 is NOT a Fibonacci prime"
          },
          "partition": {
            "name": "partition",
            "description": "Is 56006 a Partition Prime?",
            "value": false,
            "display": "56006 is NOT a Partition prime"
          },
          "pell": {
            "name": "pell",
            "description": "Is 56006 a Pell Prime?",
            "value": false,
            "display": "56006 is NOT a Pell prime"
          }
        },
        "recreational": {
          "reverse": {
            "name": "reverse",
            "description": "Number 56006 reversed",
            "value": "60065",
            "display": "60065"
          },
          "digitssum": {
            "name": "digitssum",
            "description": "Sum of the digits",
            "value": 17,
            "display": 17
          },
          "noofdigits": {
            "name": "noofdigits",
            "description": "No of digits",
            "value": 5,
            "display": 5
          }
        },
        "category": "nod"
      }
    }
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Convert base 10 representation of a given number to chinese numeral.
{{baseUrl}}/numbers/numeral/chinese
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/numeral/chinese");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/numeral/chinese" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/numeral/chinese"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/numeral/chinese"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/numeral/chinese");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/numeral/chinese"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/numeral/chinese HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/numeral/chinese")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/numeral/chinese"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/numeral/chinese")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/numeral/chinese")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/numeral/chinese');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/numeral/chinese',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/numeral/chinese';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/numeral/chinese',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/numeral/chinese")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/numeral/chinese',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/numeral/chinese',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/numeral/chinese');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/numeral/chinese',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/numeral/chinese';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/numeral/chinese"]
                                                       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 "{{baseUrl}}/numbers/numeral/chinese" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/numeral/chinese",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/numeral/chinese', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/numeral/chinese');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/numeral/chinese');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/numeral/chinese' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/numeral/chinese' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/numeral/chinese", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/numeral/chinese"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/numeral/chinese"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/numeral/chinese")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/numeral/chinese') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/numeral/chinese";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/numeral/chinese \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/numeral/chinese \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/numeral/chinese
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/numeral/chinese")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 4568367,
    "system": "chinese",
    "result": ""
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Convert base 10 representation of a given number to egyptian numeral.
{{baseUrl}}/numbers/numeral/egyptian
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/numeral/egyptian");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/numeral/egyptian" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/numeral/egyptian"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/numeral/egyptian"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/numeral/egyptian");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/numeral/egyptian"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/numeral/egyptian HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/numeral/egyptian")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/numeral/egyptian"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/numeral/egyptian")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/numeral/egyptian")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/numeral/egyptian');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/numeral/egyptian',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/numeral/egyptian';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/numeral/egyptian',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/numeral/egyptian")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/numeral/egyptian',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/numeral/egyptian',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/numeral/egyptian');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/numeral/egyptian',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/numeral/egyptian';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/numeral/egyptian"]
                                                       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 "{{baseUrl}}/numbers/numeral/egyptian" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/numeral/egyptian",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/numeral/egyptian', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/numeral/egyptian');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/numeral/egyptian');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/numeral/egyptian' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/numeral/egyptian' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/numeral/egyptian", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/numeral/egyptian"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/numeral/egyptian"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/numeral/egyptian")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/numeral/egyptian') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/numeral/egyptian";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/numeral/egyptian \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/numeral/egyptian \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/numeral/egyptian
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/numeral/egyptian")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 4568367,
    "system": "egyptian",
    "result": ""
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Convert base 10 representation of a given number to roman numeral.
{{baseUrl}}/numbers/numeral/roman
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/numeral/roman");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/numeral/roman" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/numeral/roman"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/numeral/roman"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/numeral/roman");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/numeral/roman"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/numeral/roman HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/numeral/roman")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/numeral/roman"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/numeral/roman")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/numeral/roman")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/numeral/roman');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/numeral/roman',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/numeral/roman';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/numeral/roman',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/numeral/roman")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/numeral/roman',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/numeral/roman',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/numeral/roman');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/numeral/roman',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/numeral/roman';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/numeral/roman"]
                                                       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 "{{baseUrl}}/numbers/numeral/roman" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/numeral/roman",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/numeral/roman', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/numeral/roman');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/numeral/roman');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/numeral/roman' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/numeral/roman' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/numeral/roman", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/numeral/roman"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/numeral/roman"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/numeral/roman")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/numeral/roman') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/numeral/roman";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/numeral/roman \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/numeral/roman \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/numeral/roman
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/numeral/roman")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 4568367,
    "system": "roman",
    "result": "DLXVMMMCCCLXVII"
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Get digits of pi (Ã,€)
{{baseUrl}}/numbers/pi
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/pi");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/pi" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/pi"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/pi"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/pi");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/pi"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/pi HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/pi")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/pi"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/pi")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/pi")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/pi');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/pi',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/pi';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/pi',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/pi")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/pi',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/pi',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/pi');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/pi',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/pi';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/pi"]
                                                       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 "{{baseUrl}}/numbers/pi" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/pi",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/pi', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/pi');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/pi');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/pi' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/pi' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/pi", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/pi"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/pi"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/pi")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/pi') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/pi";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/pi \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/pi \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/pi
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/pi")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "cotents": {
    "from": 0,
    "to": 100,
    "result": "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679",
    "number": "pi"
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
} 
GET Checks whether a given number is a known fermat prime number or not.
{{baseUrl}}/numbers/prime/is-fermat-prime
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/prime/is-fermat-prime");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/prime/is-fermat-prime" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/prime/is-fermat-prime"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/prime/is-fermat-prime"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/prime/is-fermat-prime");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/prime/is-fermat-prime"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/prime/is-fermat-prime HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/prime/is-fermat-prime")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/prime/is-fermat-prime"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-fermat-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/prime/is-fermat-prime")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/prime/is-fermat-prime');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-fermat-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/prime/is-fermat-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/prime/is-fermat-prime',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-fermat-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/prime/is-fermat-prime',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-fermat-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/prime/is-fermat-prime');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-fermat-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/prime/is-fermat-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/prime/is-fermat-prime"]
                                                       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 "{{baseUrl}}/numbers/prime/is-fermat-prime" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/prime/is-fermat-prime",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/prime/is-fermat-prime', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/prime/is-fermat-prime');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/prime/is-fermat-prime');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/prime/is-fermat-prime' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/prime/is-fermat-prime' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/prime/is-fermat-prime", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/prime/is-fermat-prime"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/prime/is-fermat-prime"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/prime/is-fermat-prime")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/prime/is-fermat-prime') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/prime/is-fermat-prime";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/prime/is-fermat-prime \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/prime/is-fermat-prime \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/prime/is-fermat-prime
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/prime/is-fermat-prime")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 257,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                    
GET Checks whether a given number is a known fibonacci prime number or not.
{{baseUrl}}/numbers/prime/is-fibonacci-prime
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/prime/is-fibonacci-prime");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/prime/is-fibonacci-prime" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/prime/is-fibonacci-prime"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/prime/is-fibonacci-prime"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/prime/is-fibonacci-prime");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/prime/is-fibonacci-prime"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/prime/is-fibonacci-prime HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/prime/is-fibonacci-prime")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/prime/is-fibonacci-prime"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-fibonacci-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/prime/is-fibonacci-prime")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/prime/is-fibonacci-prime');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-fibonacci-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/prime/is-fibonacci-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/prime/is-fibonacci-prime',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-fibonacci-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/prime/is-fibonacci-prime',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-fibonacci-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/prime/is-fibonacci-prime');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-fibonacci-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/prime/is-fibonacci-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/prime/is-fibonacci-prime"]
                                                       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 "{{baseUrl}}/numbers/prime/is-fibonacci-prime" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/prime/is-fibonacci-prime",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/prime/is-fibonacci-prime', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/prime/is-fibonacci-prime');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/prime/is-fibonacci-prime');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/prime/is-fibonacci-prime' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/prime/is-fibonacci-prime' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/prime/is-fibonacci-prime", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/prime/is-fibonacci-prime"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/prime/is-fibonacci-prime"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/prime/is-fibonacci-prime")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/prime/is-fibonacci-prime') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/prime/is-fibonacci-prime";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/prime/is-fibonacci-prime \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/prime/is-fibonacci-prime \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/prime/is-fibonacci-prime
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/prime/is-fibonacci-prime")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 1597,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                    
GET Checks whether a given number is a known mersenne prime number or not.
{{baseUrl}}/numbers/prime/is-mersenne-prime
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/prime/is-mersenne-prime");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/prime/is-mersenne-prime" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/prime/is-mersenne-prime"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/prime/is-mersenne-prime"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/prime/is-mersenne-prime");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/prime/is-mersenne-prime"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/prime/is-mersenne-prime HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/prime/is-mersenne-prime")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/prime/is-mersenne-prime"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-mersenne-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/prime/is-mersenne-prime")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/prime/is-mersenne-prime');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-mersenne-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/prime/is-mersenne-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/prime/is-mersenne-prime',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-mersenne-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/prime/is-mersenne-prime',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-mersenne-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/prime/is-mersenne-prime');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-mersenne-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/prime/is-mersenne-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/prime/is-mersenne-prime"]
                                                       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 "{{baseUrl}}/numbers/prime/is-mersenne-prime" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/prime/is-mersenne-prime",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/prime/is-mersenne-prime', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/prime/is-mersenne-prime');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/prime/is-mersenne-prime');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/prime/is-mersenne-prime' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/prime/is-mersenne-prime' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/prime/is-mersenne-prime", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/prime/is-mersenne-prime"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/prime/is-mersenne-prime"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/prime/is-mersenne-prime")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/prime/is-mersenne-prime') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/prime/is-mersenne-prime";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/prime/is-mersenne-prime \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/prime/is-mersenne-prime \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/prime/is-mersenne-prime
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/prime/is-mersenne-prime")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 8191,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Checks whether a given number is a known partition prime number or not.
{{baseUrl}}/numbers/prime/is-partition-prime
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/prime/is-partition-prime");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/prime/is-partition-prime" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/prime/is-partition-prime"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/prime/is-partition-prime"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/prime/is-partition-prime");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/prime/is-partition-prime"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/prime/is-partition-prime HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/prime/is-partition-prime")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/prime/is-partition-prime"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-partition-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/prime/is-partition-prime")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/prime/is-partition-prime');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-partition-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/prime/is-partition-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/prime/is-partition-prime',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-partition-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/prime/is-partition-prime',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-partition-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/prime/is-partition-prime');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-partition-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/prime/is-partition-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/prime/is-partition-prime"]
                                                       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 "{{baseUrl}}/numbers/prime/is-partition-prime" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/prime/is-partition-prime",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/prime/is-partition-prime', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/prime/is-partition-prime');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/prime/is-partition-prime');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/prime/is-partition-prime' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/prime/is-partition-prime' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/prime/is-partition-prime", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/prime/is-partition-prime"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/prime/is-partition-prime"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/prime/is-partition-prime")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/prime/is-partition-prime') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/prime/is-partition-prime";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/prime/is-partition-prime \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/prime/is-partition-prime \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/prime/is-partition-prime
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/prime/is-partition-prime")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 33461,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Checks whether a given number is a known pell prime number or not.
{{baseUrl}}/numbers/prime/is-pell-prime
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/prime/is-pell-prime");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/prime/is-pell-prime" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/prime/is-pell-prime"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/prime/is-pell-prime"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/prime/is-pell-prime");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/prime/is-pell-prime"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/prime/is-pell-prime HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/prime/is-pell-prime")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/prime/is-pell-prime"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-pell-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/prime/is-pell-prime")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/prime/is-pell-prime');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-pell-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/prime/is-pell-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/prime/is-pell-prime',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-pell-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/prime/is-pell-prime',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-pell-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/prime/is-pell-prime');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-pell-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/prime/is-pell-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/prime/is-pell-prime"]
                                                       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 "{{baseUrl}}/numbers/prime/is-pell-prime" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/prime/is-pell-prime",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/prime/is-pell-prime', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/prime/is-pell-prime');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/prime/is-pell-prime');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/prime/is-pell-prime' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/prime/is-pell-prime' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/prime/is-pell-prime", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/prime/is-pell-prime"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/prime/is-pell-prime"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/prime/is-pell-prime")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/prime/is-pell-prime') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/prime/is-pell-prime";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/prime/is-pell-prime \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/prime/is-pell-prime \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/prime/is-pell-prime
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/prime/is-pell-prime")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 33461,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
} 
GET Checks whether a given number is a known prime number or not.
{{baseUrl}}/numbers/prime/is-prime
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/prime/is-prime");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/prime/is-prime" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/prime/is-prime"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/prime/is-prime"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/prime/is-prime");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/prime/is-prime"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/prime/is-prime HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/prime/is-prime")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/prime/is-prime"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/prime/is-prime")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/prime/is-prime');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/prime/is-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/prime/is-prime',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-prime")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/prime/is-prime',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/prime/is-prime');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-prime',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/prime/is-prime';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/prime/is-prime"]
                                                       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 "{{baseUrl}}/numbers/prime/is-prime" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/prime/is-prime",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/prime/is-prime', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/prime/is-prime');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/prime/is-prime');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/prime/is-prime' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/prime/is-prime' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/prime/is-prime", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/prime/is-prime"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/prime/is-prime"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/prime/is-prime")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/prime/is-prime') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/prime/is-prime";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/prime/is-prime \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/prime/is-prime \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/prime/is-prime
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/prime/is-prime")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 227,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
} 
GET Checks whether a given number is a perfect number or not.
{{baseUrl}}/numbers/prime/is-perfect
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/prime/is-perfect");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/prime/is-perfect" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/prime/is-perfect"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/prime/is-perfect"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/prime/is-perfect");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/prime/is-perfect"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/prime/is-perfect HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/prime/is-perfect")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/prime/is-perfect"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-perfect")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/prime/is-perfect")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/prime/is-perfect');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-perfect',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/prime/is-perfect';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/prime/is-perfect',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/prime/is-perfect")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/prime/is-perfect',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-perfect',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/prime/is-perfect');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/is-perfect',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/prime/is-perfect';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/prime/is-perfect"]
                                                       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 "{{baseUrl}}/numbers/prime/is-perfect" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/prime/is-perfect",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/prime/is-perfect', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/prime/is-perfect');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/prime/is-perfect');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/prime/is-perfect' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/prime/is-perfect' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/prime/is-perfect", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/prime/is-perfect"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/prime/is-perfect"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/prime/is-perfect")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/prime/is-perfect') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/prime/is-perfect";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/prime/is-perfect \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/prime/is-perfect \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/prime/is-perfect
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/prime/is-perfect")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 8128,
    "answer": true
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
} 
GET Get the prime factors of a given number.
{{baseUrl}}/numbers/prime/factors
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/prime/factors");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/prime/factors" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/prime/factors"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/prime/factors"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/prime/factors");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/prime/factors"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/prime/factors HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/prime/factors")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/prime/factors"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/prime/factors")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/prime/factors")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/prime/factors');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/factors',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/prime/factors';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/prime/factors',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/prime/factors")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/prime/factors',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/factors',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/prime/factors');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/prime/factors',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/prime/factors';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/prime/factors"]
                                                       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 "{{baseUrl}}/numbers/prime/factors" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/prime/factors",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/prime/factors', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/prime/factors');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/prime/factors');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/prime/factors' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/prime/factors' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/prime/factors", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/prime/factors"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/prime/factors"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/prime/factors")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/prime/factors') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/prime/factors";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/prime/factors \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/prime/factors \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/prime/factors
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/prime/factors")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 228,
    "answer": [
      {
        "factor": 2,
        "times": 2
      },
      {
        "factor": 3,
        "times": 1
      },
      {
        "factor": 19,
        "times": 1
      }
    ],
    "prime-factors": [
      {
        "factor": 2,
        "times": 2
      },
      {
        "factor": 3,
        "times": 1
      },
      {
        "factor": 19,
        "times": 1
      }
    ]
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                      
GET Get the cardinal of the given number
{{baseUrl}}/numbers/cardinal
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/cardinal");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/cardinal" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/cardinal"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/cardinal"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/cardinal");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/cardinal"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/cardinal HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/cardinal")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/cardinal"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/cardinal")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/cardinal")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/cardinal');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/cardinal',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/cardinal';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/cardinal',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/cardinal")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/cardinal',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/cardinal',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/cardinal');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/cardinal',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/cardinal';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/cardinal"]
                                                       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 "{{baseUrl}}/numbers/cardinal" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/cardinal",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/cardinal', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/cardinal');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/cardinal');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/cardinal' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/cardinal' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/cardinal", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/cardinal"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/cardinal"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/cardinal")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/cardinal') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/cardinal";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/cardinal \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/cardinal \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/cardinal
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/cardinal")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 2342,
    "language": "en_US",
    "result": "two thousand three hundred forty-two",
    "cardinal": "two thousand three hundred forty-two"
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Get the ordinal of the given number
{{baseUrl}}/numbers/ordinal
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/ordinal");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/ordinal" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/ordinal"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/ordinal"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/ordinal");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/ordinal"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/ordinal HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/ordinal")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/ordinal"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/ordinal")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/ordinal")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/ordinal');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/ordinal',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/ordinal';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/ordinal',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/ordinal")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/ordinal',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/ordinal',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/ordinal');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/ordinal',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/ordinal';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/ordinal"]
                                                       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 "{{baseUrl}}/numbers/ordinal" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/ordinal",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/ordinal', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/ordinal');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/ordinal');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/ordinal' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/ordinal' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/ordinal", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/ordinal"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/ordinal"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/ordinal")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/ordinal') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/ordinal";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/ordinal \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/ordinal \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/ordinal
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/ordinal")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 2342,
    "result": "2342nd",
    "ordinal": "2342nd"
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Spells out the number as a currency
{{baseUrl}}/numbers/currency
HEADERS

X-Mathtools-Api-Secret
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/numbers/currency");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-mathtools-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/numbers/currency" {:headers {:x-mathtools-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/numbers/currency"
headers = HTTP::Headers{
  "x-mathtools-api-secret" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/numbers/currency"),
    Headers =
    {
        { "x-mathtools-api-secret", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/numbers/currency");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-mathtools-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/numbers/currency"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-mathtools-api-secret", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/numbers/currency HTTP/1.1
X-Mathtools-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/numbers/currency")
  .setHeader("x-mathtools-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/numbers/currency"))
    .header("x-mathtools-api-secret", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/numbers/currency")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/numbers/currency")
  .header("x-mathtools-api-secret", "{{apiKey}}")
  .asString();
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', '{{baseUrl}}/numbers/currency');
xhr.setRequestHeader('x-mathtools-api-secret', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/currency',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/numbers/currency';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/numbers/currency',
  method: 'GET',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/numbers/currency")
  .get()
  .addHeader("x-mathtools-api-secret", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/numbers/currency',
  headers: {
    'x-mathtools-api-secret': '{{apiKey}}'
  }
};

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();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/currency',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/numbers/currency');

req.headers({
  'x-mathtools-api-secret': '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/numbers/currency',
  headers: {'x-mathtools-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/numbers/currency';
const options = {method: 'GET', headers: {'x-mathtools-api-secret': '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-mathtools-api-secret": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/numbers/currency"]
                                                       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 "{{baseUrl}}/numbers/currency" in
let headers = Header.add (Header.init ()) "x-mathtools-api-secret" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/numbers/currency",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-mathtools-api-secret: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/numbers/currency', [
  'headers' => [
    'x-mathtools-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/numbers/currency');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/numbers/currency');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-mathtools-api-secret' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/numbers/currency' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-mathtools-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/numbers/currency' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'x-mathtools-api-secret': "{{apiKey}}" }

conn.request("GET", "/baseUrl/numbers/currency", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/numbers/currency"

headers = {"x-mathtools-api-secret": "{{apiKey}}"}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/numbers/currency"

response <- VERB("GET", url, add_headers('x-mathtools-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/numbers/currency")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-mathtools-api-secret"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/numbers/currency') do |req|
  req.headers['x-mathtools-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/numbers/currency";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-mathtools-api-secret", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/numbers/currency \
  --header 'x-mathtools-api-secret: {{apiKey}}'
http GET {{baseUrl}}/numbers/currency \
  x-mathtools-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-mathtools-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/numbers/currency
import Foundation

let headers = ["x-mathtools-api-secret": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/numbers/currency")! 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()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "success": {
    "total": 1
  },
  "copyright": {
    "copyright": "2019-21 https://math.tools"
  },
  "contents": {
    "number": 1345456654,
    "language": "en_US",
    "result": "one billion three hundred forty-five million four hundred fifty-six thousand six hundred fifty-four dollars",
    "currency": "one billion three hundred forty-five million four hundred fifty-six thousand six hundred fifty-four dollars"
  }
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}