GET Generate pirate lorem ipsum.
{{baseUrl}}/pirate/generate/lorem-ipsum
HEADERS

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

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/pirate/generate/lorem-ipsum");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-fungenerators-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}}/pirate/generate/lorem-ipsum" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/pirate/generate/lorem-ipsum"
headers = HTTP::Headers{
  "x-fungenerators-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}}/pirate/generate/lorem-ipsum"),
    Headers =
    {
        { "x-fungenerators-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}}/pirate/generate/lorem-ipsum");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-fungenerators-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/pirate/generate/lorem-ipsum"

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

	req.Header.Add("x-fungenerators-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/pirate/generate/lorem-ipsum HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/pirate/generate/lorem-ipsum")
  .setHeader("x-fungenerators-api-secret", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/pirate/generate/lorem-ipsum"))
    .header("x-fungenerators-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}}/pirate/generate/lorem-ipsum")
  .get()
  .addHeader("x-fungenerators-api-secret", "{{apiKey}}")
  .build();

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

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

const options = {
  method: 'GET',
  url: '{{baseUrl}}/pirate/generate/lorem-ipsum',
  headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/pirate/generate/lorem-ipsum';
const options = {method: 'GET', headers: {'x-fungenerators-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}}/pirate/generate/lorem-ipsum',
  method: 'GET',
  headers: {
    'x-fungenerators-api-secret': '{{apiKey}}'
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/pirate/generate/lorem-ipsum")
  .get()
  .addHeader("x-fungenerators-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/pirate/generate/lorem-ipsum',
  headers: {
    'x-fungenerators-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}}/pirate/generate/lorem-ipsum',
  headers: {'x-fungenerators-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}}/pirate/generate/lorem-ipsum');

req.headers({
  'x-fungenerators-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}}/pirate/generate/lorem-ipsum',
  headers: {'x-fungenerators-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}}/pirate/generate/lorem-ipsum';
const options = {method: 'GET', headers: {'x-fungenerators-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-fungenerators-api-secret": @"{{apiKey}}" };

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

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/pirate/generate/lorem-ipsum",
  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-fungenerators-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}}/pirate/generate/lorem-ipsum', [
  'headers' => [
    'x-fungenerators-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/pirate/generate/lorem-ipsum');
$request->setMethod(HTTP_METH_GET);

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

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/pirate/generate/lorem-ipsum');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-fungenerators-api-secret' => '{{apiKey}}'
]);

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

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

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

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

conn.request("GET", "/baseUrl/pirate/generate/lorem-ipsum", headers=headers)

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

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

url = "{{baseUrl}}/pirate/generate/lorem-ipsum"

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

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

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

url <- "{{baseUrl}}/pirate/generate/lorem-ipsum"

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

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

url = URI("{{baseUrl}}/pirate/generate/lorem-ipsum")

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

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

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

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

response = conn.get('/baseUrl/pirate/generate/lorem-ipsum') do |req|
  req.headers['x-fungenerators-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/pirate/generate/lorem-ipsum";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-fungenerators-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}}/pirate/generate/lorem-ipsum \
  --header 'x-fungenerators-api-secret: {{apiKey}}'
http GET {{baseUrl}}/pirate/generate/lorem-ipsum \
  x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-fungenerators-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/pirate/generate/lorem-ipsum
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/pirate/generate/lorem-ipsum")! 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": 4,
    "limit": 4
  },
  "contents": {
    "lorem-ipsum": "[\"Wanna shiver me timbers? \\u201cI\\u2019ve got a jar of dirt! I\\u2019ve got a jar of dirt, and guess what\\u2019s inside it?\\u201d \\u201cWhy is the rum always gone?\\u201d \\u201cYes, I do heartily repent. I repent I had not done more mischief; and that we did not cut the throats of them that took us, and I am extremely sorry that you aren\\u2019t hanged as well as we. \\u201d It is when pirates count their booty that they become mere thieves. Arrrrrrrr Piracy \\u2013 Hostile take over.\",\"Avast, me proud beauty! Wanna know why my Roger is so Jolly?  Ya know, darlin\\u2019, I\\u2019m 97 percent chum free Wanna shiver me timbers? Give me freedom or give me the rope. For I shall not take the shackles that subjugate the poor to uphold the rich. \\u201cYes, I do heartily repent. I repent I had not done more mischief; and that we did not cut the throats of them that took us, and I am extremely sorry that you aren\\u2019t hanged as well as we. \\u201d But I am touched by y\\u2019loyalty mate. Piracy \\u2013 Hostile take over.\",\"How\\u2019d you like to scrape the barnacles off of me rudder? That\\u2019s the finest pirate booty I\\u2019ve ever laid eyes on. C\\u2019mon, lad, shiver me timbers! To err is human but to arr is pirate!!\",\"Yes, that is a hornpipe in my pocket and I am happy to see you. Aye, I guarantee ye, I\\u2019ve had a twenty percent decrease in me \\u201clice ratio!\\u201d Why is the rum gone? Drink up me hearties yoho \\u2026a pirates life for me Where there is a sea there are pirates. \\u201cYes, I do heartily repent. I repent I had not done more mischief; and that we did not cut the throats of them that took us, and I am extremely sorry that you aren\\u2019t hanged as well as we. \\u201d\"]"
  },
  "copyright": "https://fungenerators.com/"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                    
GET Generate random pirate insults.
{{baseUrl}}/pirate/generate/insult
HEADERS

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

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/pirate/generate/insult");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-fungenerators-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}}/pirate/generate/insult" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/pirate/generate/insult"
headers = HTTP::Headers{
  "x-fungenerators-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}}/pirate/generate/insult"),
    Headers =
    {
        { "x-fungenerators-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}}/pirate/generate/insult");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-fungenerators-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/pirate/generate/insult"

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

	req.Header.Add("x-fungenerators-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/pirate/generate/insult HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com

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

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/pirate/generate/insult"))
    .header("x-fungenerators-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}}/pirate/generate/insult")
  .get()
  .addHeader("x-fungenerators-api-secret", "{{apiKey}}")
  .build();

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

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

const options = {
  method: 'GET',
  url: '{{baseUrl}}/pirate/generate/insult',
  headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/pirate/generate/insult';
const options = {method: 'GET', headers: {'x-fungenerators-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}}/pirate/generate/insult',
  method: 'GET',
  headers: {
    'x-fungenerators-api-secret': '{{apiKey}}'
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/pirate/generate/insult")
  .get()
  .addHeader("x-fungenerators-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/pirate/generate/insult',
  headers: {
    'x-fungenerators-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}}/pirate/generate/insult',
  headers: {'x-fungenerators-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}}/pirate/generate/insult');

req.headers({
  'x-fungenerators-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}}/pirate/generate/insult',
  headers: {'x-fungenerators-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}}/pirate/generate/insult';
const options = {method: 'GET', headers: {'x-fungenerators-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-fungenerators-api-secret": @"{{apiKey}}" };

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

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/pirate/generate/insult",
  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-fungenerators-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}}/pirate/generate/insult', [
  'headers' => [
    'x-fungenerators-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/pirate/generate/insult');
$request->setMethod(HTTP_METH_GET);

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

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

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

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

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

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

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

conn.request("GET", "/baseUrl/pirate/generate/insult", headers=headers)

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

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

url = "{{baseUrl}}/pirate/generate/insult"

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

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

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

url <- "{{baseUrl}}/pirate/generate/insult"

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

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

url = URI("{{baseUrl}}/pirate/generate/insult")

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

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

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

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

response = conn.get('/baseUrl/pirate/generate/insult') do |req|
  req.headers['x-fungenerators-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

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

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-fungenerators-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}}/pirate/generate/insult \
  --header 'x-fungenerators-api-secret: {{apiKey}}'
http GET {{baseUrl}}/pirate/generate/insult \
  x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-fungenerators-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/pirate/generate/insult
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/pirate/generate/insult")! 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": 5,
    "limit": 5
  },
  "contents": {
    "taunts": [
      "It's all great fun 'til somebody loses an eye! ye swashbucklin' deck-swabbing Orlop!",
      "Go pose in front o' the mirror some more plait bearded dung munchin Duffle!",
      "Kill my parrot will ye? I'm gonna knot yer legs together ye  loot-stealing narwhal-smelling bat-spit!",
      "Welcome to PAIN TIME with a Pirate! Starring YOU! ye squiffy deck-swabbing bilge rat!",
      "Blow it out yer bilge! ye rat-eating grog-drinking Jolly Roger!"
    ]
  },
  "copyright": "https://fungenerators.com/"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}                    
GET Generate random pirate names.
{{baseUrl}}/pirate/generate/name
HEADERS

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

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/pirate/generate/name");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-fungenerators-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}}/pirate/generate/name" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/pirate/generate/name"
headers = HTTP::Headers{
  "x-fungenerators-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}}/pirate/generate/name"),
    Headers =
    {
        { "x-fungenerators-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}}/pirate/generate/name");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-fungenerators-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/pirate/generate/name"

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

	req.Header.Add("x-fungenerators-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/pirate/generate/name HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com

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

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/pirate/generate/name"))
    .header("x-fungenerators-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}}/pirate/generate/name")
  .get()
  .addHeader("x-fungenerators-api-secret", "{{apiKey}}")
  .build();

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

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

const options = {
  method: 'GET',
  url: '{{baseUrl}}/pirate/generate/name',
  headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/pirate/generate/name';
const options = {method: 'GET', headers: {'x-fungenerators-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}}/pirate/generate/name',
  method: 'GET',
  headers: {
    'x-fungenerators-api-secret': '{{apiKey}}'
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/pirate/generate/name")
  .get()
  .addHeader("x-fungenerators-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/pirate/generate/name',
  headers: {
    'x-fungenerators-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}}/pirate/generate/name',
  headers: {'x-fungenerators-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}}/pirate/generate/name');

req.headers({
  'x-fungenerators-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}}/pirate/generate/name',
  headers: {'x-fungenerators-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}}/pirate/generate/name';
const options = {method: 'GET', headers: {'x-fungenerators-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-fungenerators-api-secret": @"{{apiKey}}" };

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

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/pirate/generate/name",
  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-fungenerators-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}}/pirate/generate/name', [
  'headers' => [
    'x-fungenerators-api-secret' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/pirate/generate/name');
$request->setMethod(HTTP_METH_GET);

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

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

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

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

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

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

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

conn.request("GET", "/baseUrl/pirate/generate/name", headers=headers)

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

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

url = "{{baseUrl}}/pirate/generate/name"

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

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

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

url <- "{{baseUrl}}/pirate/generate/name"

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

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

url = URI("{{baseUrl}}/pirate/generate/name")

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

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

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

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

response = conn.get('/baseUrl/pirate/generate/name') do |req|
  req.headers['x-fungenerators-api-secret'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

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

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-fungenerators-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}}/pirate/generate/name \
  --header 'x-fungenerators-api-secret: {{apiKey}}'
http GET {{baseUrl}}/pirate/generate/name \
  x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-fungenerators-api-secret: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/pirate/generate/name
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/pirate/generate/name")! 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": 5,
    "start": 0,
    "limit": 5
  },
  "contents": {
    "variation": "male",
    "names": [
      "Mabry 'Devil's Smile' Hades",
      "Rae 'The Wrath' Rakshasas",
      "Thorndike 'Merry' Tyndall",
      "Crofton 'The Lion' Dante",
      "Southwell 'Squealer' Sweete"
    ]
  },
  "copyright": "https://fungenerators.com/"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
GET Translate from English to pirate.
{{baseUrl}}/pirate/translate
HEADERS

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

text
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/pirate/translate?text=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-fungenerators-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}}/pirate/translate" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}
                                                            :query-params {:text ""}})
require "http/client"

url = "{{baseUrl}}/pirate/translate?text="
headers = HTTP::Headers{
  "x-fungenerators-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}}/pirate/translate?text="),
    Headers =
    {
        { "x-fungenerators-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}}/pirate/translate?text=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-fungenerators-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/pirate/translate?text="

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

	req.Header.Add("x-fungenerators-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/pirate/translate?text= HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com

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

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/pirate/translate?text="))
    .header("x-fungenerators-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}}/pirate/translate?text=")
  .get()
  .addHeader("x-fungenerators-api-secret", "{{apiKey}}")
  .build();

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

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

const options = {
  method: 'GET',
  url: '{{baseUrl}}/pirate/translate',
  params: {text: ''},
  headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/pirate/translate?text=';
const options = {method: 'GET', headers: {'x-fungenerators-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}}/pirate/translate?text=',
  method: 'GET',
  headers: {
    'x-fungenerators-api-secret': '{{apiKey}}'
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/pirate/translate?text=")
  .get()
  .addHeader("x-fungenerators-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/pirate/translate?text=',
  headers: {
    'x-fungenerators-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}}/pirate/translate',
  qs: {text: ''},
  headers: {'x-fungenerators-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}}/pirate/translate');

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

req.headers({
  'x-fungenerators-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}}/pirate/translate',
  params: {text: ''},
  headers: {'x-fungenerators-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}}/pirate/translate?text=';
const options = {method: 'GET', headers: {'x-fungenerators-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-fungenerators-api-secret": @"{{apiKey}}" };

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

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/pirate/translate?text=",
  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-fungenerators-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}}/pirate/translate?text=', [
  'headers' => [
    'x-fungenerators-api-secret' => '{{apiKey}}',
  ],
]);

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

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

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

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

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

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

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

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

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

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

conn.request("GET", "/baseUrl/pirate/translate?text=", headers=headers)

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

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

url = "{{baseUrl}}/pirate/translate"

querystring = {"text":""}

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

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

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

url <- "{{baseUrl}}/pirate/translate"

queryString <- list(text = "")

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

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

url = URI("{{baseUrl}}/pirate/translate?text=")

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

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

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

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

response = conn.get('/baseUrl/pirate/translate') do |req|
  req.headers['x-fungenerators-api-secret'] = '{{apiKey}}'
  req.params['text'] = ''
end

puts response.status
puts response.body
use reqwest;

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

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

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-fungenerators-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}}/pirate/translate?text=' \
  --header 'x-fungenerators-api-secret: {{apiKey}}'
http GET '{{baseUrl}}/pirate/translate?text=' \
  x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-fungenerators-api-secret: {{apiKey}}' \
  --output-document \
  - '{{baseUrl}}/pirate/translate?text='
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/pirate/translate?text=")! 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
  },
  "contents": {
    "translated": "Ahoy matey!  Splice the mainbrace! me dear ol' mum, bless her black soul goes with me t' th' briny deep.",
    "text": "Hello sir! my mother goes with me to the ocean."
  },
  "copyright": "https://fungenerators.com/"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}