Proxy API
Proxy APIv9.3.0
Welcome to the Proxy API. You can use this API to access all Proxy API endpoints. Base URL The base URL for all API requests is https://unify.apideck.com Headers Custom headers that are expected as part of the request. Note that RFC7230 states header names are case insensitive. | Name | Type | Required | Description | | ---------------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Authorization | String | Yes |…
- Endpoints
- 6 (1 GET, 1 PUT, 1 POST, 1 DELETE)
- Base URL
https://unify.apideck.com- Authentication
- API key
- Spec format
- OpenAPI 3.0.3
- API version
- 9.3.0
- Provider
- apideck.com
- License
- Apache 2.0
- Categories
- Developer Tools
- Last updated
Use this API in Bruno:
- Download the Bruno collection above and unzip it.
- In Bruno, choose Open Collection and select the unzipped folder.
- Set the
baseUrlvariable (for examplehttps://unify.apideck.com) and your API key credentials, then send requests.
DELETE
DELETE
{{baseUrl}}/proxy
HEADERS
x-apideck-consumer-id
x-apideck-app-id
x-apideck-service-id
x-apideck-downstream-url
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/proxy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "x-apideck-service-id: ");
headers = curl_slist_append(headers, "x-apideck-downstream-url: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/proxy" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:x-apideck-service-id ""
:x-apideck-downstream-url ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/proxy"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"x-apideck-service-id" => ""
"x-apideck-downstream-url" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/proxy"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "x-apideck-service-id", "" },
{ "x-apideck-downstream-url", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/proxy");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("x-apideck-service-id", "");
request.AddHeader("x-apideck-downstream-url", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/proxy"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("x-apideck-service-id", "")
req.Header.Add("x-apideck-downstream-url", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/proxy HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
X-Apideck-Service-Id:
X-Apideck-Downstream-Url:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/proxy")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("x-apideck-service-id", "")
.setHeader("x-apideck-downstream-url", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/proxy"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", 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}}/proxy")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/proxy")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{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('DELETE', '{{baseUrl}}/proxy');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('x-apideck-service-id', '');
xhr.setRequestHeader('x-apideck-downstream-url', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/proxy';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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}}/proxy',
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/proxy")
.delete(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'DELETE',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/proxy');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'DELETE',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/proxy';
const options = {
method: 'DELETE',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"x-apideck-service-id": @"",
@"x-apideck-downstream-url": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/proxy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[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}}/proxy" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("x-apideck-service-id", "");
("x-apideck-downstream-url", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: ",
"x-apideck-downstream-url: ",
"x-apideck-service-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/proxy', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
'x-apideck-downstream-url' => '',
'x-apideck-service-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/proxy');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/proxy');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/proxy' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/proxy' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'x-apideck-service-id': "",
'x-apideck-downstream-url': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/proxy", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/proxy"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/proxy"
response <- VERB("DELETE", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'x-apideck-service-id' = '', 'x-apideck-downstream-url' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/proxy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["x-apideck-service-id"] = ''
request["x-apideck-downstream-url"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/proxy') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['x-apideck-service-id'] = ''
req.headers['x-apideck-downstream-url'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/proxy";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("x-apideck-service-id", "".parse().unwrap());
headers.insert("x-apideck-downstream-url", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/proxy \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'x-apideck-service-id: '
http DELETE {{baseUrl}}/proxy \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:'' \
x-apideck-downstream-url:'' \
x-apideck-service-id:''
wget --quiet \
--method DELETE \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-service-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/proxy
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/proxy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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
{}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
GET
GET
{{baseUrl}}/proxy
HEADERS
x-apideck-consumer-id
x-apideck-app-id
x-apideck-service-id
x-apideck-downstream-url
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/proxy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "x-apideck-service-id: ");
headers = curl_slist_append(headers, "x-apideck-downstream-url: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/proxy" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:x-apideck-service-id ""
:x-apideck-downstream-url ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/proxy"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"x-apideck-service-id" => ""
"x-apideck-downstream-url" => ""
"authorization" => "{{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}}/proxy"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "x-apideck-service-id", "" },
{ "x-apideck-downstream-url", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/proxy");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("x-apideck-service-id", "");
request.AddHeader("x-apideck-downstream-url", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/proxy"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("x-apideck-service-id", "")
req.Header.Add("x-apideck-downstream-url", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/proxy HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
X-Apideck-Service-Id:
X-Apideck-Downstream-Url:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/proxy")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("x-apideck-service-id", "")
.setHeader("x-apideck-downstream-url", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/proxy"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{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}}/proxy")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/proxy")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{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}}/proxy');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('x-apideck-service-id', '');
xhr.setRequestHeader('x-apideck-downstream-url', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/proxy';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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}}/proxy',
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/proxy")
.get()
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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}}/proxy');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/proxy';
const options = {
method: 'GET',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"x-apideck-service-id": @"",
@"x-apideck-downstream-url": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/proxy"]
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}}/proxy" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("x-apideck-service-id", "");
("x-apideck-downstream-url", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: ",
"x-apideck-downstream-url: ",
"x-apideck-service-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/proxy', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
'x-apideck-downstream-url' => '',
'x-apideck-service-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/proxy');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/proxy');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/proxy' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/proxy' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'x-apideck-service-id': "",
'x-apideck-downstream-url': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/proxy", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/proxy"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/proxy"
response <- VERB("GET", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'x-apideck-service-id' = '', 'x-apideck-downstream-url' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/proxy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["x-apideck-service-id"] = ''
request["x-apideck-downstream-url"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/proxy') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['x-apideck-service-id'] = ''
req.headers['x-apideck-downstream-url'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/proxy";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("x-apideck-service-id", "".parse().unwrap());
headers.insert("x-apideck-downstream-url", "".parse().unwrap());
headers.insert("authorization", "{{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}}/proxy \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'x-apideck-service-id: '
http GET {{baseUrl}}/proxy \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:'' \
x-apideck-downstream-url:'' \
x-apideck-service-id:''
wget --quiet \
--method GET \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-service-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/proxy
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/proxy")! 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
{}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
OPTIONS
OPTIONS
{{baseUrl}}/proxy
HEADERS
x-apideck-consumer-id
x-apideck-app-id
x-apideck-service-id
x-apideck-downstream-url
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "OPTIONS");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/proxy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "x-apideck-service-id: ");
headers = curl_slist_append(headers, "x-apideck-downstream-url: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/options "{{baseUrl}}/proxy" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:x-apideck-service-id ""
:x-apideck-downstream-url ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/proxy"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"x-apideck-service-id" => ""
"x-apideck-downstream-url" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.options url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Options,
RequestUri = new Uri("{{baseUrl}}/proxy"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "x-apideck-service-id", "" },
{ "x-apideck-downstream-url", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/proxy");
var request = new RestRequest("", Method.Options);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("x-apideck-service-id", "");
request.AddHeader("x-apideck-downstream-url", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/proxy"
req, _ := http.NewRequest("OPTIONS", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("x-apideck-service-id", "")
req.Header.Add("x-apideck-downstream-url", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
OPTIONS /baseUrl/proxy HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
X-Apideck-Service-Id:
X-Apideck-Downstream-Url:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("OPTIONS", "{{baseUrl}}/proxy")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("x-apideck-service-id", "")
.setHeader("x-apideck-downstream-url", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/proxy"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{apiKey}}")
.method("OPTIONS", 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}}/proxy")
.method("OPTIONS", null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.options("{{baseUrl}}/proxy")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{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('OPTIONS', '{{baseUrl}}/proxy');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('x-apideck-service-id', '');
xhr.setRequestHeader('x-apideck-downstream-url', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'OPTIONS',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/proxy';
const options = {
method: 'OPTIONS',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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}}/proxy',
method: 'OPTIONS',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/proxy")
.method("OPTIONS", null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'OPTIONS',
hostname: 'example.com',
port: null,
path: '/baseUrl/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'OPTIONS',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('OPTIONS', '{{baseUrl}}/proxy');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'OPTIONS',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/proxy';
const options = {
method: 'OPTIONS',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"x-apideck-service-id": @"",
@"x-apideck-downstream-url": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/proxy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"OPTIONS"];
[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}}/proxy" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("x-apideck-service-id", "");
("x-apideck-downstream-url", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `OPTIONS uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "OPTIONS",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: ",
"x-apideck-downstream-url: ",
"x-apideck-service-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('OPTIONS', '{{baseUrl}}/proxy', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
'x-apideck-downstream-url' => '',
'x-apideck-service-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/proxy');
$request->setMethod(HTTP_METH_OPTIONS);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/proxy');
$request->setRequestMethod('OPTIONS');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/proxy' -Method OPTIONS -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/proxy' -Method OPTIONS -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'x-apideck-service-id': "",
'x-apideck-downstream-url': "",
'authorization': "{{apiKey}}"
}
conn.request("OPTIONS", "/baseUrl/proxy", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/proxy"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
}
response = requests.options(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/proxy"
response <- VERB("OPTIONS", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'x-apideck-service-id' = '', 'x-apideck-downstream-url' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/proxy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Options.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["x-apideck-service-id"] = ''
request["x-apideck-downstream-url"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.options('/baseUrl/proxy') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['x-apideck-service-id'] = ''
req.headers['x-apideck-downstream-url'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/proxy";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("x-apideck-service-id", "".parse().unwrap());
headers.insert("x-apideck-downstream-url", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("OPTIONS").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request OPTIONS \
--url {{baseUrl}}/proxy \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'x-apideck-service-id: '
http OPTIONS {{baseUrl}}/proxy \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:'' \
x-apideck-downstream-url:'' \
x-apideck-service-id:''
wget --quiet \
--method OPTIONS \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-service-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/proxy
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/proxy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "OPTIONS"
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
{}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
PATCH
PATCH
{{baseUrl}}/proxy
HEADERS
x-apideck-consumer-id
x-apideck-app-id
x-apideck-service-id
x-apideck-downstream-url
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/proxy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "x-apideck-service-id: ");
headers = curl_slist_append(headers, "x-apideck-downstream-url: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/proxy" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:x-apideck-service-id ""
:x-apideck-downstream-url ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/proxy"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"x-apideck-service-id" => ""
"x-apideck-downstream-url" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.patch url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/proxy"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "x-apideck-service-id", "" },
{ "x-apideck-downstream-url", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/proxy");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("x-apideck-service-id", "");
request.AddHeader("x-apideck-downstream-url", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/proxy"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("x-apideck-service-id", "")
req.Header.Add("x-apideck-downstream-url", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/proxy HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
X-Apideck-Service-Id:
X-Apideck-Downstream-Url:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/proxy")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("x-apideck-service-id", "")
.setHeader("x-apideck-downstream-url", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/proxy"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{apiKey}}")
.method("PATCH", 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}}/proxy")
.patch(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/proxy")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{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('PATCH', '{{baseUrl}}/proxy');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('x-apideck-service-id', '');
xhr.setRequestHeader('x-apideck-downstream-url', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/proxy';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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}}/proxy',
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/proxy")
.patch(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'PATCH',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/proxy');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'PATCH',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/proxy';
const options = {
method: 'PATCH',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"x-apideck-service-id": @"",
@"x-apideck-downstream-url": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/proxy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/proxy" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("x-apideck-service-id", "");
("x-apideck-downstream-url", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: ",
"x-apideck-downstream-url: ",
"x-apideck-service-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/proxy', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
'x-apideck-downstream-url' => '',
'x-apideck-service-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/proxy');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/proxy');
$request->setRequestMethod('PATCH');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/proxy' -Method PATCH -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/proxy' -Method PATCH -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'x-apideck-service-id': "",
'x-apideck-downstream-url': "",
'authorization': "{{apiKey}}"
}
conn.request("PATCH", "/baseUrl/proxy", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/proxy"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
}
response = requests.patch(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/proxy"
response <- VERB("PATCH", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'x-apideck-service-id' = '', 'x-apideck-downstream-url' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/proxy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["x-apideck-service-id"] = ''
request["x-apideck-downstream-url"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.patch('/baseUrl/proxy') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['x-apideck-service-id'] = ''
req.headers['x-apideck-downstream-url'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/proxy";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("x-apideck-service-id", "".parse().unwrap());
headers.insert("x-apideck-downstream-url", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/proxy \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'x-apideck-service-id: '
http PATCH {{baseUrl}}/proxy \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:'' \
x-apideck-downstream-url:'' \
x-apideck-service-id:''
wget --quiet \
--method PATCH \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-service-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/proxy
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/proxy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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
{}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
POST
POST
{{baseUrl}}/proxy
HEADERS
x-apideck-consumer-id
x-apideck-app-id
x-apideck-service-id
x-apideck-downstream-url
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/proxy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "x-apideck-service-id: ");
headers = curl_slist_append(headers, "x-apideck-downstream-url: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/proxy" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:x-apideck-service-id ""
:x-apideck-downstream-url ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/proxy"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"x-apideck-service-id" => ""
"x-apideck-downstream-url" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/proxy"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "x-apideck-service-id", "" },
{ "x-apideck-downstream-url", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/proxy");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("x-apideck-service-id", "");
request.AddHeader("x-apideck-downstream-url", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/proxy"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("x-apideck-service-id", "")
req.Header.Add("x-apideck-downstream-url", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/proxy HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
X-Apideck-Service-Id:
X-Apideck-Downstream-Url:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/proxy")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("x-apideck-service-id", "")
.setHeader("x-apideck-downstream-url", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/proxy"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{apiKey}}")
.method("POST", 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}}/proxy")
.post(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/proxy")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{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('POST', '{{baseUrl}}/proxy');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('x-apideck-service-id', '');
xhr.setRequestHeader('x-apideck-downstream-url', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/proxy';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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}}/proxy',
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/proxy")
.post(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'POST',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/proxy');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'POST',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/proxy';
const options = {
method: 'POST',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"x-apideck-service-id": @"",
@"x-apideck-downstream-url": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/proxy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[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}}/proxy" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("x-apideck-service-id", "");
("x-apideck-downstream-url", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: ",
"x-apideck-downstream-url: ",
"x-apideck-service-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/proxy', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
'x-apideck-downstream-url' => '',
'x-apideck-service-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/proxy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/proxy');
$request->setRequestMethod('POST');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/proxy' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/proxy' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'x-apideck-service-id': "",
'x-apideck-downstream-url': "",
'authorization': "{{apiKey}}"
}
conn.request("POST", "/baseUrl/proxy", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/proxy"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/proxy"
response <- VERB("POST", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'x-apideck-service-id' = '', 'x-apideck-downstream-url' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/proxy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["x-apideck-service-id"] = ''
request["x-apideck-downstream-url"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/proxy') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['x-apideck-service-id'] = ''
req.headers['x-apideck-downstream-url'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/proxy";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("x-apideck-service-id", "".parse().unwrap());
headers.insert("x-apideck-downstream-url", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/proxy \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'x-apideck-service-id: '
http POST {{baseUrl}}/proxy \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:'' \
x-apideck-downstream-url:'' \
x-apideck-service-id:''
wget --quiet \
--method POST \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-service-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/proxy
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/proxy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
{}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}
PUT
PUT
{{baseUrl}}/proxy
HEADERS
x-apideck-consumer-id
x-apideck-app-id
x-apideck-service-id
x-apideck-downstream-url
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/proxy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-consumer-id: ");
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "x-apideck-service-id: ");
headers = curl_slist_append(headers, "x-apideck-downstream-url: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/proxy" {:headers {:x-apideck-consumer-id ""
:x-apideck-app-id ""
:x-apideck-service-id ""
:x-apideck-downstream-url ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/proxy"
headers = HTTP::Headers{
"x-apideck-consumer-id" => ""
"x-apideck-app-id" => ""
"x-apideck-service-id" => ""
"x-apideck-downstream-url" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/proxy"),
Headers =
{
{ "x-apideck-consumer-id", "" },
{ "x-apideck-app-id", "" },
{ "x-apideck-service-id", "" },
{ "x-apideck-downstream-url", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/proxy");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-apideck-consumer-id", "");
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("x-apideck-service-id", "");
request.AddHeader("x-apideck-downstream-url", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/proxy"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-apideck-consumer-id", "")
req.Header.Add("x-apideck-app-id", "")
req.Header.Add("x-apideck-service-id", "")
req.Header.Add("x-apideck-downstream-url", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/proxy HTTP/1.1
X-Apideck-Consumer-Id:
X-Apideck-App-Id:
X-Apideck-Service-Id:
X-Apideck-Downstream-Url:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/proxy")
.setHeader("x-apideck-consumer-id", "")
.setHeader("x-apideck-app-id", "")
.setHeader("x-apideck-service-id", "")
.setHeader("x-apideck-downstream-url", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/proxy"))
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{apiKey}}")
.method("PUT", 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}}/proxy")
.put(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/proxy")
.header("x-apideck-consumer-id", "")
.header("x-apideck-app-id", "")
.header("x-apideck-service-id", "")
.header("x-apideck-downstream-url", "")
.header("authorization", "{{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('PUT', '{{baseUrl}}/proxy');
xhr.setRequestHeader('x-apideck-consumer-id', '');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('x-apideck-service-id', '');
xhr.setRequestHeader('x-apideck-downstream-url', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/proxy';
const options = {
method: 'PUT',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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}}/proxy',
method: 'PUT',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/proxy")
.put(null)
.addHeader("x-apideck-consumer-id", "")
.addHeader("x-apideck-app-id", "")
.addHeader("x-apideck-service-id", "")
.addHeader("x-apideck-downstream-url", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'PUT',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/proxy');
req.headers({
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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: 'PUT',
url: '{{baseUrl}}/proxy',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{apiKey}}'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/proxy';
const options = {
method: 'PUT',
headers: {
'x-apideck-consumer-id': '',
'x-apideck-app-id': '',
'x-apideck-service-id': '',
'x-apideck-downstream-url': '',
authorization: '{{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-apideck-consumer-id": @"",
@"x-apideck-app-id": @"",
@"x-apideck-service-id": @"",
@"x-apideck-downstream-url": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/proxy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/proxy" in
let headers = Header.add_list (Header.init ()) [
("x-apideck-consumer-id", "");
("x-apideck-app-id", "");
("x-apideck-service-id", "");
("x-apideck-downstream-url", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-apideck-app-id: ",
"x-apideck-consumer-id: ",
"x-apideck-downstream-url: ",
"x-apideck-service-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/proxy', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-apideck-app-id' => '',
'x-apideck-consumer-id' => '',
'x-apideck-downstream-url' => '',
'x-apideck-service-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/proxy');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/proxy');
$request->setRequestMethod('PUT');
$request->setHeaders([
'x-apideck-consumer-id' => '',
'x-apideck-app-id' => '',
'x-apideck-service-id' => '',
'x-apideck-downstream-url' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/proxy' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-apideck-consumer-id", "")
$headers.Add("x-apideck-app-id", "")
$headers.Add("x-apideck-service-id", "")
$headers.Add("x-apideck-downstream-url", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/proxy' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-apideck-consumer-id': "",
'x-apideck-app-id': "",
'x-apideck-service-id': "",
'x-apideck-downstream-url': "",
'authorization': "{{apiKey}}"
}
conn.request("PUT", "/baseUrl/proxy", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/proxy"
headers = {
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
}
response = requests.put(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/proxy"
response <- VERB("PUT", url, add_headers('x-apideck-consumer-id' = '', 'x-apideck-app-id' = '', 'x-apideck-service-id' = '', 'x-apideck-downstream-url' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/proxy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-apideck-consumer-id"] = ''
request["x-apideck-app-id"] = ''
request["x-apideck-service-id"] = ''
request["x-apideck-downstream-url"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/proxy') do |req|
req.headers['x-apideck-consumer-id'] = ''
req.headers['x-apideck-app-id'] = ''
req.headers['x-apideck-service-id'] = ''
req.headers['x-apideck-downstream-url'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/proxy";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-apideck-consumer-id", "".parse().unwrap());
headers.insert("x-apideck-app-id", "".parse().unwrap());
headers.insert("x-apideck-service-id", "".parse().unwrap());
headers.insert("x-apideck-downstream-url", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/proxy \
--header 'authorization: {{apiKey}}' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'x-apideck-service-id: '
http PUT {{baseUrl}}/proxy \
authorization:'{{apiKey}}' \
x-apideck-app-id:'' \
x-apideck-consumer-id:'' \
x-apideck-downstream-url:'' \
x-apideck-service-id:''
wget --quiet \
--method PUT \
--header 'x-apideck-consumer-id: ' \
--header 'x-apideck-app-id: ' \
--header 'x-apideck-service-id: ' \
--header 'x-apideck-downstream-url: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/proxy
import Foundation
let headers = [
"x-apideck-consumer-id": "",
"x-apideck-app-id": "",
"x-apideck-service-id": "",
"x-apideck-downstream-url": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/proxy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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
{}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
"error": "Unauthorized",
"message": "Unauthorized Request",
"ref": "https://developers.apideck.com/errors#unauthorizederror",
"status_code": 401,
"type_name": "UnauthorizedError"
}