Barcode API
POST
Decode a Barcode image and return the cotents if successful
{{baseUrl}}/barcode/decode
HEADERS
X-Fungenerators-Api-Secret
{{apiKey}}
BODY formUrlEncoded
barimage
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/barcode/decode");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-fungenerators-api-secret: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "barimage=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/barcode/decode" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}
:form-params {:barimage ""}})
require "http/client"
url = "{{baseUrl}}/barcode/decode"
headers = HTTP::Headers{
"x-fungenerators-api-secret" => "{{apiKey}}"
"content-type" => "application/x-www-form-urlencoded"
}
reqBody = "barimage="
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/barcode/decode"),
Headers =
{
{ "x-fungenerators-api-secret", "{{apiKey}}" },
},
Content = new FormUrlEncodedContent(new Dictionary
{
{ "barimage", "" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/barcode/decode");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-fungenerators-api-secret", "{{apiKey}}");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "barimage=", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/barcode/decode"
payload := strings.NewReader("barimage=")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-fungenerators-api-secret", "{{apiKey}}")
req.Header.Add("content-type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/barcode/decode HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Content-Type: application/x-www-form-urlencoded
Host: example.com
Content-Length: 9
barimage=
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/barcode/decode")
.setHeader("x-fungenerators-api-secret", "{{apiKey}}")
.setHeader("content-type", "application/x-www-form-urlencoded")
.setBody("barimage=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/barcode/decode"))
.header("x-fungenerators-api-secret", "{{apiKey}}")
.header("content-type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("barimage="))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "barimage=");
Request request = new Request.Builder()
.url("{{baseUrl}}/barcode/decode")
.post(body)
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/barcode/decode")
.header("x-fungenerators-api-secret", "{{apiKey}}")
.header("content-type", "application/x-www-form-urlencoded")
.body("barimage=")
.asString();
const data = 'barimage=';
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/barcode/decode');
xhr.setRequestHeader('x-fungenerators-api-secret', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
xhr.send(data);
import axios from 'axios';
const encodedParams = new URLSearchParams();
encodedParams.set('barimage', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/barcode/decode',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}',
'content-type': 'application/x-www-form-urlencoded'
},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/barcode/decode';
const options = {
method: 'POST',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}',
'content-type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({barimage: ''})
};
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}}/barcode/decode',
method: 'POST',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}',
'content-type': 'application/x-www-form-urlencoded'
},
data: {
barimage: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/x-www-form-urlencoded")
val body = RequestBody.create(mediaType, "barimage=")
val request = Request.Builder()
.url("{{baseUrl}}/barcode/decode")
.post(body)
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build()
val response = client.newCall(request).execute()
const qs = require('querystring');
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/barcode/decode',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}',
'content-type': 'application/x-www-form-urlencoded'
}
};
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.write(qs.stringify({barimage: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/barcode/decode',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}',
'content-type': 'application/x-www-form-urlencoded'
},
form: {barimage: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/barcode/decode');
req.headers({
'x-fungenerators-api-secret': '{{apiKey}}',
'content-type': 'application/x-www-form-urlencoded'
});
req.form({
barimage: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const { URLSearchParams } = require('url');
const encodedParams = new URLSearchParams();
encodedParams.set('barimage', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/barcode/decode',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}',
'content-type': 'application/x-www-form-urlencoded'
},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set('barimage', '');
const url = '{{baseUrl}}/barcode/decode';
const options = {
method: 'POST',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}',
'content-type': 'application/x-www-form-urlencoded'
},
body: encodedParams
};
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}}",
@"content-type": @"application/x-www-form-urlencoded" };
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"barimage=" dataUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/barcode/decode"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
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}}/barcode/decode" in
let headers = Header.add_list (Header.init ()) [
("x-fungenerators-api-secret", "{{apiKey}}");
("content-type", "application/x-www-form-urlencoded");
] in
let body = Cohttp_lwt_body.of_string "barimage=" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/barcode/decode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "barimage=",
CURLOPT_HTTPHEADER => [
"content-type: application/x-www-form-urlencoded",
"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('POST', '{{baseUrl}}/barcode/decode', [
'form_params' => [
'barimage' => ''
],
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
'x-fungenerators-api-secret' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/barcode/decode');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-fungenerators-api-secret' => '{{apiKey}}',
'content-type' => 'application/x-www-form-urlencoded'
]);
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields([
'barimage' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(new http\QueryString([
'barimage' => ''
]));
$request->setRequestUrl('{{baseUrl}}/barcode/decode');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-fungenerators-api-secret' => '{{apiKey}}',
'content-type' => 'application/x-www-form-urlencoded'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/barcode/decode' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'barimage='
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/barcode/decode' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'barimage='
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "barimage="
headers = {
'x-fungenerators-api-secret': "{{apiKey}}",
'content-type': "application/x-www-form-urlencoded"
}
conn.request("POST", "/baseUrl/barcode/decode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/barcode/decode"
payload = { "barimage": "" }
headers = {
"x-fungenerators-api-secret": "{{apiKey}}",
"content-type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/barcode/decode"
payload <- "barimage="
encode <- "form"
response <- VERB("POST", url, body = payload, add_headers('x-fungenerators-api-secret' = '{{apiKey}}'), content_type("application/x-www-form-urlencoded"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/barcode/decode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-fungenerators-api-secret"] = '{{apiKey}}'
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "barimage="
response = http.request(request)
puts response.read_body
require 'faraday'
data = {
:barimage => "",
}
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/x-www-form-urlencoded'}
)
response = conn.post('/baseUrl/barcode/decode') do |req|
req.headers['x-fungenerators-api-secret'] = '{{apiKey}}'
req.body = URI.encode_www_form(data)
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/barcode/decode";
let payload = json!({"barimage": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-fungenerators-api-secret", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/x-www-form-urlencoded".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.form(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/barcode/decode \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'x-fungenerators-api-secret: {{apiKey}}' \
--data barimage=
http --form POST {{baseUrl}}/barcode/decode \
content-type:application/x-www-form-urlencoded \
x-fungenerators-api-secret:'{{apiKey}}' \
barimage=''
wget --quiet \
--method POST \
--header 'x-fungenerators-api-secret: {{apiKey}}' \
--header 'content-type: application/x-www-form-urlencoded' \
--body-data barimage= \
--output-document \
- {{baseUrl}}/barcode/decode
import Foundation
let headers = [
"x-fungenerators-api-secret": "{{apiKey}}",
"content-type": "application/x-www-form-urlencoded"
]
let postData = NSMutableData(data: "barimage=".data(using: String.Encoding.utf8)!)
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/barcode/decode")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
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": [
{
"value": 234567,
"format": 'C39',
"content_type": "number"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": {
"code": 401,
"message": "Unauthorized"
}
}
GET
Get a Bar Code image for the given barcode number
{{baseUrl}}/barcode/encode
HEADERS
X-Fungenerators-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}}/barcode/encode?number=");
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}}/barcode/encode" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}
:query-params {:number ""}})
require "http/client"
url = "{{baseUrl}}/barcode/encode?number="
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}}/barcode/encode?number="),
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}}/barcode/encode?number=");
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}}/barcode/encode?number="
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/barcode/encode?number= HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/barcode/encode?number=")
.setHeader("x-fungenerators-api-secret", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/barcode/encode?number="))
.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}}/barcode/encode?number=")
.get()
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/barcode/encode?number=")
.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}}/barcode/encode?number=');
xhr.setRequestHeader('x-fungenerators-api-secret', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/barcode/encode',
params: {number: ''},
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/barcode/encode?number=';
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}}/barcode/encode?number=',
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}}/barcode/encode?number=")
.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/barcode/encode?number=',
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}}/barcode/encode',
qs: {number: ''},
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}}/barcode/encode');
req.query({
number: ''
});
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}}/barcode/encode',
params: {number: ''},
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}}/barcode/encode?number=';
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}}/barcode/encode?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}}/barcode/encode?number=" 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}}/barcode/encode?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-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}}/barcode/encode?number=', [
'headers' => [
'x-fungenerators-api-secret' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/barcode/encode');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'number' => ''
]);
$request->setHeaders([
'x-fungenerators-api-secret' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/barcode/encode');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'number' => ''
]));
$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}}/barcode/encode?number=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/barcode/encode?number=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-fungenerators-api-secret': "{{apiKey}}" }
conn.request("GET", "/baseUrl/barcode/encode?number=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/barcode/encode"
querystring = {"number":""}
headers = {"x-fungenerators-api-secret": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/barcode/encode"
queryString <- list(number = "")
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}}/barcode/encode?number=")
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/barcode/encode') do |req|
req.headers['x-fungenerators-api-secret'] = '{{apiKey}}'
req.params['number'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/barcode/encode";
let querystring = [
("number", ""),
];
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}}/barcode/encode?number=' \
--header 'x-fungenerators-api-secret: {{apiKey}}'
http GET '{{baseUrl}}/barcode/encode?number=' \
x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-fungenerators-api-secret: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/barcode/encode?number='
import Foundation
let headers = ["x-fungenerators-api-secret": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/barcode/encode?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
},
"contents": [
{
"encoding": "base64",
"format": "png",
"content": "",
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": {
"code": 401,
"message": "Unauthorized"
}
}
GET
Get the supported barcode types for encoding - image generation.
{{baseUrl}}/barcode/encode/types
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}}/barcode/encode/types");
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}}/barcode/encode/types" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/barcode/encode/types"
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}}/barcode/encode/types"),
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}}/barcode/encode/types");
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}}/barcode/encode/types"
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/barcode/encode/types HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/barcode/encode/types")
.setHeader("x-fungenerators-api-secret", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/barcode/encode/types"))
.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}}/barcode/encode/types")
.get()
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/barcode/encode/types")
.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}}/barcode/encode/types');
xhr.setRequestHeader('x-fungenerators-api-secret', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/barcode/encode/types',
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/barcode/encode/types';
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}}/barcode/encode/types',
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}}/barcode/encode/types")
.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/barcode/encode/types',
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}}/barcode/encode/types',
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}}/barcode/encode/types');
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}}/barcode/encode/types',
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}}/barcode/encode/types';
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}}/barcode/encode/types"]
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}}/barcode/encode/types" 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}}/barcode/encode/types",
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}}/barcode/encode/types', [
'headers' => [
'x-fungenerators-api-secret' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/barcode/encode/types');
$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}}/barcode/encode/types');
$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}}/barcode/encode/types' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/barcode/encode/types' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-fungenerators-api-secret': "{{apiKey}}" }
conn.request("GET", "/baseUrl/barcode/encode/types", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/barcode/encode/types"
headers = {"x-fungenerators-api-secret": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/barcode/encode/types"
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}}/barcode/encode/types")
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/barcode/encode/types') 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}}/barcode/encode/types";
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}}/barcode/encode/types \
--header 'x-fungenerators-api-secret: {{apiKey}}'
http GET {{baseUrl}}/barcode/encode/types \
x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-fungenerators-api-secret: {{apiKey}}' \
--output-document \
- {{baseUrl}}/barcode/encode/types
import Foundation
let headers = ["x-fungenerators-api-secret": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/barcode/encode/types")! 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":28},
"contents": {"types":
{
"C39":"Code 39",
"C39CKSUM":"Code 39 with Checksum",
"C39E":"Extended Code 39",
"C39ECKSUM":"Extended Code 39 With Checksum",
"C93":"Code 93",
"S25":"Standard 2 of 5",
"S25CKSUM":"Standard 2 of 5 with Checksum",
"I25":"Interleaved 2 of 5",
"I25CKSUM":"Interleaved 2 of 5 with Checksum",
"UPCA":"UPC-A",
"UPCE":"UPC-E",
"C128":"Code 128 (Standard)",
"C128A":"Code 128-A",
"C128B":"Code 128-B",
"C128C":"Code 128-C",
"EAN8":"EAN-8",
"EAN13":"EAN-13",
"MSI":"MSI Plessey",
"MSICKSUM":"MSI with Checksum",
"POSTNET":"POSTNET",
"PLANET":"PLANET",
"RMS4CC":"RMS4CC \/ CBC",
"KIX":"KIX",
"IMB":"IMB",
"CODABAR":"CODABAR",
"CODE11":"Code 11",
"PHARMA":"Pharma One-Track",
"PHARMA2T":"Pharma Two-Track"
}
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": {
"code": 401,
"message": "Unauthorized"
}
}
GET
Get the supported barcode types for the decoding process.
{{baseUrl}}/barcode/decode/types
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}}/barcode/decode/types");
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}}/barcode/decode/types" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/barcode/decode/types"
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}}/barcode/decode/types"),
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}}/barcode/decode/types");
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}}/barcode/decode/types"
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/barcode/decode/types HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/barcode/decode/types")
.setHeader("x-fungenerators-api-secret", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/barcode/decode/types"))
.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}}/barcode/decode/types")
.get()
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/barcode/decode/types")
.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}}/barcode/decode/types');
xhr.setRequestHeader('x-fungenerators-api-secret', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/barcode/decode/types',
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/barcode/decode/types';
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}}/barcode/decode/types',
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}}/barcode/decode/types")
.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/barcode/decode/types',
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}}/barcode/decode/types',
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}}/barcode/decode/types');
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}}/barcode/decode/types',
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}}/barcode/decode/types';
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}}/barcode/decode/types"]
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}}/barcode/decode/types" 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}}/barcode/decode/types",
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}}/barcode/decode/types', [
'headers' => [
'x-fungenerators-api-secret' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/barcode/decode/types');
$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}}/barcode/decode/types');
$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}}/barcode/decode/types' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/barcode/decode/types' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-fungenerators-api-secret': "{{apiKey}}" }
conn.request("GET", "/baseUrl/barcode/decode/types", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/barcode/decode/types"
headers = {"x-fungenerators-api-secret": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/barcode/decode/types"
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}}/barcode/decode/types")
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/barcode/decode/types') 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}}/barcode/decode/types";
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}}/barcode/decode/types \
--header 'x-fungenerators-api-secret: {{apiKey}}'
http GET {{baseUrl}}/barcode/decode/types \
x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-fungenerators-api-secret: {{apiKey}}' \
--output-document \
- {{baseUrl}}/barcode/decode/types
import Foundation
let headers = ["x-fungenerators-api-secret": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/barcode/decode/types")! 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":28},
"contents":
{
"types":
{
"C39":"Code 39",
"C39CKSUM":"Code 39 with Checksum",
"C39E":"Extended Code 39",
"C39ECKSUM":"Extended Code 39 With Checksum",
"C93":"Code 93",
"I25":"Interleaved 2 of 5",
"I25CKSUM":"Interleaved 2 of 5 with Checksum",
"C128":"Code 128 (Standard)",
"C128A":"Code 128-A",
"C128B":"Code 128-B",
"C128C":"Code 128-C",
"CODABAR":"CODABAR"
}
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": {
"code": 401,
"message": "Unauthorized"
}
}