PhantAuth
POST
Create a Client Selfie
{{baseUrl}}/client
BODY json
{
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": [],
"grant_types": [],
"jwks": [],
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": [],
"response_types": [],
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/client");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/client" {:content-type :json
:form-params {:@id ""
:client_id ""
:client_name ""
:client_secret ""
:client_uri ""
:contacts []
:grant_types []
:jwks []
:jwks_uri ""
:logo_email ""
:logo_uri ""
:policy_uri ""
:redirect_uris []
:response_types []
:scope ""
:software_id ""
:software_version ""
:token_endpoint_auth_method ""
:tos_uri ""}})
require "http/client"
url = "{{baseUrl}}/client"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/client"),
Content = new StringContent("{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/client");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/client"
payload := strings.NewReader("{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/client HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 389
{
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": [],
"grant_types": [],
"jwks": [],
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": [],
"response_types": [],
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/client")
.setHeader("content-type", "application/json")
.setBody("{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/client"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/client")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/client")
.header("content-type", "application/json")
.body("{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}")
.asString();
const data = JSON.stringify({
'@id': '',
client_id: '',
client_name: '',
client_secret: '',
client_uri: '',
contacts: [],
grant_types: [],
jwks: [],
jwks_uri: '',
logo_email: '',
logo_uri: '',
policy_uri: '',
redirect_uris: [],
response_types: [],
scope: '',
software_id: '',
software_version: '',
token_endpoint_auth_method: '',
tos_uri: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/client');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/client',
headers: {'content-type': 'application/json'},
data: {
'@id': '',
client_id: '',
client_name: '',
client_secret: '',
client_uri: '',
contacts: [],
grant_types: [],
jwks: [],
jwks_uri: '',
logo_email: '',
logo_uri: '',
policy_uri: '',
redirect_uris: [],
response_types: [],
scope: '',
software_id: '',
software_version: '',
token_endpoint_auth_method: '',
tos_uri: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/client';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"@id":"","client_id":"","client_name":"","client_secret":"","client_uri":"","contacts":[],"grant_types":[],"jwks":[],"jwks_uri":"","logo_email":"","logo_uri":"","policy_uri":"","redirect_uris":[],"response_types":[],"scope":"","software_id":"","software_version":"","token_endpoint_auth_method":"","tos_uri":""}'
};
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}}/client',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "@id": "",\n "client_id": "",\n "client_name": "",\n "client_secret": "",\n "client_uri": "",\n "contacts": [],\n "grant_types": [],\n "jwks": [],\n "jwks_uri": "",\n "logo_email": "",\n "logo_uri": "",\n "policy_uri": "",\n "redirect_uris": [],\n "response_types": [],\n "scope": "",\n "software_id": "",\n "software_version": "",\n "token_endpoint_auth_method": "",\n "tos_uri": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/client")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/client',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
'@id': '',
client_id: '',
client_name: '',
client_secret: '',
client_uri: '',
contacts: [],
grant_types: [],
jwks: [],
jwks_uri: '',
logo_email: '',
logo_uri: '',
policy_uri: '',
redirect_uris: [],
response_types: [],
scope: '',
software_id: '',
software_version: '',
token_endpoint_auth_method: '',
tos_uri: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/client',
headers: {'content-type': 'application/json'},
body: {
'@id': '',
client_id: '',
client_name: '',
client_secret: '',
client_uri: '',
contacts: [],
grant_types: [],
jwks: [],
jwks_uri: '',
logo_email: '',
logo_uri: '',
policy_uri: '',
redirect_uris: [],
response_types: [],
scope: '',
software_id: '',
software_version: '',
token_endpoint_auth_method: '',
tos_uri: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/client');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
'@id': '',
client_id: '',
client_name: '',
client_secret: '',
client_uri: '',
contacts: [],
grant_types: [],
jwks: [],
jwks_uri: '',
logo_email: '',
logo_uri: '',
policy_uri: '',
redirect_uris: [],
response_types: [],
scope: '',
software_id: '',
software_version: '',
token_endpoint_auth_method: '',
tos_uri: ''
});
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}}/client',
headers: {'content-type': 'application/json'},
data: {
'@id': '',
client_id: '',
client_name: '',
client_secret: '',
client_uri: '',
contacts: [],
grant_types: [],
jwks: [],
jwks_uri: '',
logo_email: '',
logo_uri: '',
policy_uri: '',
redirect_uris: [],
response_types: [],
scope: '',
software_id: '',
software_version: '',
token_endpoint_auth_method: '',
tos_uri: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/client';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"@id":"","client_id":"","client_name":"","client_secret":"","client_uri":"","contacts":[],"grant_types":[],"jwks":[],"jwks_uri":"","logo_email":"","logo_uri":"","policy_uri":"","redirect_uris":[],"response_types":[],"scope":"","software_id":"","software_version":"","token_endpoint_auth_method":"","tos_uri":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"@id": @"",
@"client_id": @"",
@"client_name": @"",
@"client_secret": @"",
@"client_uri": @"",
@"contacts": @[ ],
@"grant_types": @[ ],
@"jwks": @[ ],
@"jwks_uri": @"",
@"logo_email": @"",
@"logo_uri": @"",
@"policy_uri": @"",
@"redirect_uris": @[ ],
@"response_types": @[ ],
@"scope": @"",
@"software_id": @"",
@"software_version": @"",
@"token_endpoint_auth_method": @"",
@"tos_uri": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/client"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/client" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/client",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'@id' => '',
'client_id' => '',
'client_name' => '',
'client_secret' => '',
'client_uri' => '',
'contacts' => [
],
'grant_types' => [
],
'jwks' => [
],
'jwks_uri' => '',
'logo_email' => '',
'logo_uri' => '',
'policy_uri' => '',
'redirect_uris' => [
],
'response_types' => [
],
'scope' => '',
'software_id' => '',
'software_version' => '',
'token_endpoint_auth_method' => '',
'tos_uri' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/client', [
'body' => '{
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": [],
"grant_types": [],
"jwks": [],
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": [],
"response_types": [],
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/client');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'@id' => '',
'client_id' => '',
'client_name' => '',
'client_secret' => '',
'client_uri' => '',
'contacts' => [
],
'grant_types' => [
],
'jwks' => [
],
'jwks_uri' => '',
'logo_email' => '',
'logo_uri' => '',
'policy_uri' => '',
'redirect_uris' => [
],
'response_types' => [
],
'scope' => '',
'software_id' => '',
'software_version' => '',
'token_endpoint_auth_method' => '',
'tos_uri' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'@id' => '',
'client_id' => '',
'client_name' => '',
'client_secret' => '',
'client_uri' => '',
'contacts' => [
],
'grant_types' => [
],
'jwks' => [
],
'jwks_uri' => '',
'logo_email' => '',
'logo_uri' => '',
'policy_uri' => '',
'redirect_uris' => [
],
'response_types' => [
],
'scope' => '',
'software_id' => '',
'software_version' => '',
'token_endpoint_auth_method' => '',
'tos_uri' => ''
]));
$request->setRequestUrl('{{baseUrl}}/client');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/client' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": [],
"grant_types": [],
"jwks": [],
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": [],
"response_types": [],
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/client' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": [],
"grant_types": [],
"jwks": [],
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": [],
"response_types": [],
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/client", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/client"
payload = {
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": [],
"grant_types": [],
"jwks": [],
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": [],
"response_types": [],
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/client"
payload <- "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/client")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/client') do |req|
req.body = "{\n \"@id\": \"\",\n \"client_id\": \"\",\n \"client_name\": \"\",\n \"client_secret\": \"\",\n \"client_uri\": \"\",\n \"contacts\": [],\n \"grant_types\": [],\n \"jwks\": [],\n \"jwks_uri\": \"\",\n \"logo_email\": \"\",\n \"logo_uri\": \"\",\n \"policy_uri\": \"\",\n \"redirect_uris\": [],\n \"response_types\": [],\n \"scope\": \"\",\n \"software_id\": \"\",\n \"software_version\": \"\",\n \"token_endpoint_auth_method\": \"\",\n \"tos_uri\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/client";
let payload = json!({
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": (),
"grant_types": (),
"jwks": (),
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": (),
"response_types": (),
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/client \
--header 'content-type: application/json' \
--data '{
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": [],
"grant_types": [],
"jwks": [],
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": [],
"response_types": [],
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
}'
echo '{
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": [],
"grant_types": [],
"jwks": [],
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": [],
"response_types": [],
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
}' | \
http POST {{baseUrl}}/client \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "@id": "",\n "client_id": "",\n "client_name": "",\n "client_secret": "",\n "client_uri": "",\n "contacts": [],\n "grant_types": [],\n "jwks": [],\n "jwks_uri": "",\n "logo_email": "",\n "logo_uri": "",\n "policy_uri": "",\n "redirect_uris": [],\n "response_types": [],\n "scope": "",\n "software_id": "",\n "software_version": "",\n "token_endpoint_auth_method": "",\n "tos_uri": ""\n}' \
--output-document \
- {{baseUrl}}/client
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"@id": "",
"client_id": "",
"client_name": "",
"client_secret": "",
"client_uri": "",
"contacts": [],
"grant_types": [],
"jwks": [],
"jwks_uri": "",
"logo_email": "",
"logo_uri": "",
"policy_uri": "",
"redirect_uris": [],
"response_types": [],
"scope": "",
"software_id": "",
"software_version": "",
"token_endpoint_auth_method": "",
"tos_uri": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/client")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
text/plain
RESPONSE BODY text
eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..HQLixaDFwfYXZ2Hu.p4zIoe54Cg3W1hQR2yIXbWMg5fC9X66si7jhz7IuB2-_2m8VuYMP6V3-e3sFsPfZsHlxpdtuSZ5eYphb5qnN-tHEEhnu2OBQDLH6FVmofpSdXVsastRiN7BcESH6-3FaJmsS-gs-C-RFn9YmlE9OdCt2CFwca5584SmSwd5lqC87ljgjKn1afPKTPqG8esxNsj3h_1qkjdzArCo94B-0Gq_dLN3vNImCW0Y9rV4ThviZQh1rFCwD1-hotmsVRwZcGIxGmQd6KtqS9MtSimdFB29QtPm64htB8OPiUZSUeD5MhYty2UyYsru-coyd4Uye59jj8LQWQOi6K5mO46sM6rOOKpVYBDMRyfKZHtw0SEjLKJYFadtnZ4kAAe7faZB8prY50FG-BtVnsWVQRbpbIeuih-iGk-X-5kQ3MEbXcBLkBIEwjVEKT7s9zjLV1NzWNeQHadzMxAa_jMRZi5bpcUxHT5GctLVVRP5_iCQX0lrh7dDkV5oNmxVj0JT7f0Fada709a9uAiVzcQa3maBWx8u7moxMhHT-CeTGXFiGRkKC3q-tXzRItaAFFhYDv38Efj23sTBwjjyK3ldWyhwVXOenzmQP9aesj8lgz0jtpzcjkW_ckRz_POM_fTF-y6M_bHb1eloCXaGem8mfTWBqWydUUWEsH6hmSI5pkmTS2k_9TQ.fu0lDi24J2c1a33NTNwU7g
GET
Get a Client Token
{{baseUrl}}/client/:client_id/token/:kind
QUERY PARAMS
client_id
kind
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/client/:client_id/token/:kind");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/client/:client_id/token/:kind")
require "http/client"
url = "{{baseUrl}}/client/:client_id/token/:kind"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/client/:client_id/token/:kind"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/client/:client_id/token/:kind");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/client/:client_id/token/:kind"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/client/:client_id/token/:kind HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/client/:client_id/token/:kind")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/client/:client_id/token/:kind"))
.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}}/client/:client_id/token/:kind")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/client/:client_id/token/:kind")
.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}}/client/:client_id/token/:kind');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/client/:client_id/token/:kind'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/client/:client_id/token/:kind';
const options = {method: 'GET'};
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}}/client/:client_id/token/:kind',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/client/:client_id/token/:kind")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/client/:client_id/token/:kind',
headers: {}
};
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}}/client/:client_id/token/:kind'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/client/:client_id/token/:kind');
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}}/client/:client_id/token/:kind'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/client/:client_id/token/:kind';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/client/:client_id/token/:kind"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/client/:client_id/token/:kind" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/client/:client_id/token/:kind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/client/:client_id/token/:kind');
echo $response->getBody();
setUrl('{{baseUrl}}/client/:client_id/token/:kind');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/client/:client_id/token/:kind');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/client/:client_id/token/:kind' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/client/:client_id/token/:kind' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/client/:client_id/token/:kind")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/client/:client_id/token/:kind"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/client/:client_id/token/:kind"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/client/:client_id/token/:kind")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/client/:client_id/token/:kind') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/client/:client_id/token/:kind";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/client/:client_id/token/:kind
http GET {{baseUrl}}/client/:client_id/token/:kind
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/client/:client_id/token/:kind
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/client/:client_id/token/:kind")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
text/plain
RESPONSE BODY text
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtYWdpYy50b29sYm94IiwidG9rZW5fa2luZCI6IlJFR0lTVFJBVElPTiIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwgYWRkcmVzcyBwaG9uZSBpbmRpZWF1dGggdWlkIiwiZXhwIjoxNTg4NDI4NDM4LCJpYXQiOjE1NTY4OTI0Mzh9.TGilMHuWIDYiBAjzXyMuBvMiRlnKFLDX7FJJW_flldg
GET
Get a Client
{{baseUrl}}/client/:client_id
QUERY PARAMS
client_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/client/:client_id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/client/:client_id")
require "http/client"
url = "{{baseUrl}}/client/:client_id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/client/:client_id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/client/:client_id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/client/:client_id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/client/:client_id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/client/:client_id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/client/:client_id"))
.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}}/client/:client_id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/client/:client_id")
.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}}/client/:client_id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/client/:client_id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/client/:client_id';
const options = {method: 'GET'};
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}}/client/:client_id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/client/:client_id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/client/:client_id',
headers: {}
};
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}}/client/:client_id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/client/:client_id');
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}}/client/:client_id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/client/:client_id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/client/:client_id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/client/:client_id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/client/:client_id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/client/:client_id');
echo $response->getBody();
setUrl('{{baseUrl}}/client/:client_id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/client/:client_id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/client/:client_id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/client/:client_id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/client/:client_id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/client/:client_id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/client/:client_id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/client/:client_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/client/:client_id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/client/:client_id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/client/:client_id
http GET {{baseUrl}}/client/:client_id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/client/:client_id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/client/:client_id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
{
"@id": "https://phantauth.net/client/magic.toolbox",
"client_id": "magic.toolbox",
"client_name": "Magic Toolbox",
"client_secret": "O68dVlLk",
"client_uri": "https://phantauth.net/client/magic.toolbox/profile",
"logo_email": "magic.toolbox.OUUWE4A@mailinator.com",
"logo_uri": "https://www.gravatar.com/avatar/23a9c0277d8e4062b01f1097037f0d5b?s=256&d=https%3A%2F%2Favatars.phantauth.net%2Ficon%2F9b68RVeE.png",
"policy_uri": "https://phantauth.net/client/magic.toolbox/policy",
"software_id": "igG6Jgx7mfzPdjhBvHvqRQ",
"software_version": "3.8.0",
"tos_uri": "https://phantauth.net/client/magic.toolbox/tos"
}
GET
Get a Domain
{{baseUrl}}/domain/:domainname
QUERY PARAMS
domainname
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/domain/:domainname");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/domain/:domainname")
require "http/client"
url = "{{baseUrl}}/domain/:domainname"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/domain/:domainname"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/domain/:domainname");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/domain/:domainname"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/domain/:domainname HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/domain/:domainname")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/domain/:domainname"))
.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}}/domain/:domainname")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/domain/:domainname")
.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}}/domain/:domainname');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/domain/:domainname'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/domain/:domainname';
const options = {method: 'GET'};
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}}/domain/:domainname',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/domain/:domainname")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/domain/:domainname',
headers: {}
};
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}}/domain/:domainname'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/domain/:domainname');
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}}/domain/:domainname'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/domain/:domainname';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/domain/:domainname"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/domain/:domainname" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/domain/:domainname",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/domain/:domainname');
echo $response->getBody();
setUrl('{{baseUrl}}/domain/:domainname');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/domain/:domainname');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/domain/:domainname' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/domain/:domainname' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/domain/:domainname")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/domain/:domainname"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/domain/:domainname"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/domain/:domainname")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/domain/:domainname') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/domain/:domainname";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/domain/:domainname
http GET {{baseUrl}}/domain/:domainname
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/domain/:domainname
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/domain/:domainname")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
{
"@id": "https://phantauth.net/domain/phantauth.net",
"logo": "https://www.phantauth.net/logo/phantauth-logo.svg",
"members": [
{
"@id": "https://phantauth.net/tenant/default",
"domain": false,
"favicon": "https://default.phantauth.net/logo/phantauth-favicon.png",
"issuer": "https://phantauth.net",
"logo": "https://default.phantauth.net/logo/phantauth-logo-light.svg",
"name": "PhantAuth Default",
"sub": "default",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"website": "https://phantauth.net"
},
{
"@id": "https://phantauth.net/_gods/tenant/gods",
"attribution": "God pictures come from [Theoi Project](https://www.theoi.com/), a site exploring Greek mythology and the gods in classical literature and art.",
"depot": "https://docs.google.com/spreadsheets/d/1Xa4mRcLWroJr2vUDhrJXGBcobYmpS8fNZxFpXw-M9DY/gviz/tq?tqx=out:csv",
"depots": [
"user",
"team"
],
"domain": false,
"favicon": "https://default.phantauth.net/logo/phantauth-favicon.png",
"flags": "medium",
"issuer": "https://phantauth.net/_gods",
"logo": "https://cdn.staticaly.com/favicons/www.theoi.com",
"name": "Greek Gods",
"sub": "gods",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/sandstone/bootstrap.min.css",
"website": "https://phantauth.net/_gods"
},
{
"@id": "https://phantauth.net/_casual/tenant/casual",
"domain": false,
"factories": [
"user"
],
"factory": "https://wt-51217f7b3eee6aead0123eeafe3b83e8-0.sandbox.auth0-extend.com/user{?name}",
"favicon": "https://default.phantauth.net/logo/phantauth-favicon.png",
"issuer": "https://phantauth.net/_casual",
"logo": "https://www.phantauth.net/logo/phantauth-logo-gray.svg",
"name": "PhantAuth Casual",
"sub": "casual",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css",
"website": "https://phantauth.net/_casual"
},
{
"@id": "https://phantauth.net/_faker/tenant/faker",
"domain": false,
"factories": [
"team",
"user"
],
"factory": "https://faker.phantauth.net/api{/kind,name}",
"favicon": "https://default.phantauth.net/logo/phantauth-favicon.png",
"flags": "small",
"issuer": "https://phantauth.net/_faker",
"logo": "https://phantauth-faker.now.sh/faker-logo.svg",
"name": "PhantAuth Faker",
"sub": "faker",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/united/bootstrap.min.css",
"website": "https://phantauth.net/_faker"
},
{
"@id": "https://phantauth.net/_uinames/tenant/uinames",
"attribution": "User data generated using [uinames.com API](https://uinames.com).",
"domain": false,
"favicon": "https://default.phantauth.net/logo/phantauth-favicon.png",
"flags": "small",
"issuer": "https://phantauth.net/_uinames",
"logo": "https://uinames.com/assets/img/ios-precomposed.png",
"name": "uinames",
"script": "https://www.phantauth.net/selfie/uinames.js",
"sub": "uinames",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/minty/bootstrap.min.css",
"website": "https://phantauth.net/_uinames"
},
{
"@id": "https://phantauth.net/_chance/tenant/chance",
"domain": false,
"factories": [
"user",
"team"
],
"factory": "https://chance.phantauth.net/api{/kind,name}",
"favicon": "https://default.phantauth.net/logo/phantauth-favicon.png",
"flags": "small",
"issuer": "https://phantauth.net/_chance",
"logo": "https://phantauth-chance.now.sh/chance-logo.png",
"name": "PhantAuth Chance",
"sub": "chance",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/united/bootstrap.min.css",
"website": "https://phantauth.net/_chance"
},
{
"@id": "https://phantauth.net/_sketch/tenant/sketch",
"domain": false,
"favicon": "https://default.phantauth.net/logo/phantauth-favicon.png",
"flags": "sketch;small",
"issuer": "https://phantauth.net/_sketch",
"logo": "https://www.phantauth.net/logo/phantauth-sketch.svg",
"name": "PhantAuth Sketch",
"sub": "sketch",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/sketchy/bootstrap.min.css",
"website": "https://phantauth.net/_sketch"
},
{
"@id": "https://phantauth.net/_randomuser/tenant/randomuser",
"attribution": "User data generated using [RANDOM USER GENERATOR](https://randomuser.me/).",
"domain": false,
"favicon": "https://default.phantauth.net/logo/phantauth-favicon.png",
"flags": "small",
"issuer": "https://phantauth.net/_randomuser",
"logo": "https://cdn.staticaly.com/favicons/randomuser.me",
"name": "RANDOM USER",
"script": "https://www.phantauth.net/selfie/randomuser.js",
"sub": "randomuser",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/sandstone/bootstrap.min.css",
"website": "https://phantauth.net/_randomuser"
},
{
"@id": "https://phantauth.net/_mockaroo/tenant/mockaroo",
"attribution": "User data generated using [Mockaroo's Mock APIs](https://mockaroo.com/mock_apis).",
"domain": false,
"favicon": "https://default.phantauth.net/logo/phantauth-favicon.png",
"flags": "small",
"issuer": "https://phantauth.net/_mockaroo",
"logo": "https://www.phantauth.net/selfie/kongaroo.svg",
"name": "Mockaroo",
"script": "https://www.phantauth.net/selfie/mockaroo.js",
"sub": "mockaroo",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/minty/bootstrap.min.css",
"website": "https://phantauth.net/_mockaroo"
},
{
"@id": "https://mockuser.ga/tenant/mockuser.ga",
"domain": false,
"favicon": "https://www.phantauth.net/brand/mockuser/mockuser-favicon.png",
"issuer": "https://mockuser.ga",
"logo": "https://www.phantauth.net/brand/mockuser/mockuser-logo-light.svg",
"name": "Mock User",
"sub": "mockuser.ga",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://www.phantauth.net/brand/mockuser/bootstrap-mockuser.min.css",
"website": "https://www.mockuser.ga"
}
],
"name": "PhantAuth Domain",
"profile": "https://phantauth.net/domain/phantauth.net/profile",
"sub": "phantauth.net"
}
GET
Get a Fleet
{{baseUrl}}/fleet/:fleetname
QUERY PARAMS
fleetname
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/fleet/:fleetname");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/fleet/:fleetname")
require "http/client"
url = "{{baseUrl}}/fleet/:fleetname"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/fleet/:fleetname"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/fleet/:fleetname");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/fleet/:fleetname"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/fleet/:fleetname HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/fleet/:fleetname")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/fleet/:fleetname"))
.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}}/fleet/:fleetname")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/fleet/:fleetname")
.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}}/fleet/:fleetname');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/fleet/:fleetname'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/fleet/:fleetname';
const options = {method: 'GET'};
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}}/fleet/:fleetname',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/fleet/:fleetname")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/fleet/:fleetname',
headers: {}
};
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}}/fleet/:fleetname'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/fleet/:fleetname');
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}}/fleet/:fleetname'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/fleet/:fleetname';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/fleet/:fleetname"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/fleet/:fleetname" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/fleet/:fleetname",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/fleet/:fleetname');
echo $response->getBody();
setUrl('{{baseUrl}}/fleet/:fleetname');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/fleet/:fleetname');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/fleet/:fleetname' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/fleet/:fleetname' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/fleet/:fleetname")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/fleet/:fleetname"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/fleet/:fleetname"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/fleet/:fleetname")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/fleet/:fleetname') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/fleet/:fleetname";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/fleet/:fleetname
http GET {{baseUrl}}/fleet/:fleetname
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/fleet/:fleetname
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/fleet/:fleetname")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
{
"@id": "https://phantauth.net/fleet/blue.fleet",
"logo": "https://www.gravatar.com/avatar/60757eca81bdd6768421ed3b669b651d?s=256&d=identicon",
"logo_email": "blue.fleet.6JBLL7Y@mailinator.com",
"members": [
{
"@id": "https://phantauth.net/client/zamit%7Eueyonuvxhz0",
"client_id": "zamit~ueyonuvxhz0",
"client_name": "Zamit",
"client_secret": "o0Ie0Ph4",
"client_uri": "https://phantauth.net/client/zamit%7Eueyonuvxhz0/profile",
"logo_email": "zamit.6UTF3FA@mailinator.com",
"logo_uri": "https://www.gravatar.com/avatar/849f9934a6aec97935cb40eadbf06d60?s=256&d=https%3A%2F%2Favatars.phantauth.net%2Ficon%2Fpnelv7bK.png",
"policy_uri": "https://phantauth.net/client/zamit%7Eueyonuvxhz0/policy",
"software_id": "tzpm4afosVpE65jyw55ZLA",
"software_version": "8.0.8",
"tos_uri": "https://phantauth.net/client/zamit%7Eueyonuvxhz0/tos"
},
{
"@id": "https://phantauth.net/client/otcom%7Ekzwnwi3dcjc",
"client_id": "otcom~kzwnwi3dcjc",
"client_name": "Otcom",
"client_secret": "W0UFeZTo",
"client_uri": "https://phantauth.net/client/otcom%7Ekzwnwi3dcjc/profile",
"logo_email": "otcom.DVC7D4Y@mailinator.com",
"logo_uri": "https://www.gravatar.com/avatar/102ea74126cec525eded6e2511ee4960?s=256&d=https%3A%2F%2Favatars.phantauth.net%2Ficon%2FQBeXrkby.png",
"policy_uri": "https://phantauth.net/client/otcom%7Ekzwnwi3dcjc/policy",
"software_id": "RqrMOl5ZNZeEoYNkCdg1AA",
"software_version": "8.0.9",
"tos_uri": "https://phantauth.net/client/otcom%7Ekzwnwi3dcjc/tos"
},
{
"@id": "https://phantauth.net/client/greenlam%7Eo3sbolv1qjc",
"client_id": "greenlam~o3sbolv1qjc",
"client_name": "Greenlam",
"client_secret": "jeXBkxJ4",
"client_uri": "https://phantauth.net/client/greenlam%7Eo3sbolv1qjc/profile",
"logo_email": "greenlam.2XD4DYQ@mailinator.com",
"logo_uri": "https://www.gravatar.com/avatar/0d304aa152b8edd056d1e7862364dec2?s=256&d=https%3A%2F%2Favatars.phantauth.net%2Ficon%2FLDdwLJe1.png",
"policy_uri": "https://phantauth.net/client/greenlam%7Eo3sbolv1qjc/policy",
"software_id": "0dQ9wd0fb1v2RPd1de-m6A",
"software_version": "6.4.2",
"tos_uri": "https://phantauth.net/client/greenlam%7Eo3sbolv1qjc/tos"
},
{
"@id": "https://phantauth.net/client/holdlamis%7E1jvzg8zw3ie",
"client_id": "holdlamis~1jvzg8zw3ie",
"client_name": "Holdlamis",
"client_secret": "N0dEVTVQ",
"client_uri": "https://phantauth.net/client/holdlamis%7E1jvzg8zw3ie/profile",
"logo_email": "holdlamis.4AP3BGI@mailinator.com",
"logo_uri": "https://www.gravatar.com/avatar/14d66b1256d484d2ab268cbe58694bb9?s=256&d=https%3A%2F%2Favatars.phantauth.net%2Ficon%2FRb4x6nbB.png",
"policy_uri": "https://phantauth.net/client/holdlamis%7E1jvzg8zw3ie/policy",
"software_id": "ReiInzn-af_1XjFhBwl2Kw",
"software_version": "9.0.5",
"tos_uri": "https://phantauth.net/client/holdlamis%7E1jvzg8zw3ie/tos"
},
{
"@id": "https://phantauth.net/client/asoka%7Evu9rsfdq16m",
"client_id": "asoka~vu9rsfdq16m",
"client_name": "Asoka",
"client_secret": "92Qz6rSU",
"client_uri": "https://phantauth.net/client/asoka%7Evu9rsfdq16m/profile",
"logo_email": "asoka.K2ZLAYQ@mailinator.com",
"logo_uri": "https://www.gravatar.com/avatar/7acc74527505772449417aed086c3b24?s=256&d=https%3A%2F%2Favatars.phantauth.net%2Ficon%2F6dBB3xd7.png",
"policy_uri": "https://phantauth.net/client/asoka%7Evu9rsfdq16m/policy",
"software_id": "s0GXgtm6HqPy0nayXt8g4w",
"software_version": "3.9.6",
"tos_uri": "https://phantauth.net/client/asoka%7Evu9rsfdq16m/tos"
}
],
"name": "Blue Fleet",
"profile": "https://phantauth.net/fleet/blue.fleet/profile",
"sub": "blue.fleet"
}
GET
Get a Team
{{baseUrl}}/team/:teamname
QUERY PARAMS
teamname
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/team/:teamname");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/team/:teamname")
require "http/client"
url = "{{baseUrl}}/team/:teamname"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/team/:teamname"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/team/:teamname");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/team/:teamname"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/team/:teamname HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/team/:teamname")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/team/:teamname"))
.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}}/team/:teamname")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/team/:teamname")
.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}}/team/:teamname');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/team/:teamname'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/team/:teamname';
const options = {method: 'GET'};
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}}/team/:teamname',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/team/:teamname")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/team/:teamname',
headers: {}
};
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}}/team/:teamname'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/team/:teamname');
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}}/team/:teamname'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/team/:teamname';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/team/:teamname"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/team/:teamname" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/team/:teamname",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/team/:teamname');
echo $response->getBody();
setUrl('{{baseUrl}}/team/:teamname');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/team/:teamname');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/team/:teamname' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/team/:teamname' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/team/:teamname")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/team/:teamname"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/team/:teamname"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/team/:teamname")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/team/:teamname') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/team/:teamname";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/team/:teamname
http GET {{baseUrl}}/team/:teamname
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/team/:teamname
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/team/:teamname")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
{
"@id": "https://phantauth.net/team/dream.team",
"logo": "https://www.gravatar.com/avatar/0d6fbd4eb21c269933ca5bba043ab4aa?s=256&d=identicon",
"logo_email": "dream.team.HIECLNQ@mailinator.com",
"members": [
{
"@id": "https://phantauth.net/user/ariana.riley.hudson",
"address": {
"country": "USA",
"formatted": "62 Highland Place APT 63\nMiami 30927",
"locality": "Miami",
"postal_code": "30927",
"street_address": "62 Highland Place APT 63"
},
"birthdate": "1938-11-19",
"email": "ariana.riley.hudson.VJ2ABXA@mailinator.com",
"email_verified": false,
"family_name": "Hudson",
"gender": "female",
"given_name": "Ariana",
"locale": "en_US",
"me": "https://phantauth.net/~ariana.riley.hudson",
"middle_name": "Riley",
"name": "Ariana Hudson",
"nickname": "Ariana",
"password": "cuTCy0IZ",
"phone_number": "552-769-0026",
"phone_number_verified": true,
"picture": "https://www.gravatar.com/avatar/8b0562dd7dd8ff1d8d872fcf58972d6d?s=256&d=https://avatars.phantauth.net/ai/female/BeXDnkey.jpg",
"preferred_username": "ahudson",
"profile": "https://phantauth.net/user/ariana.riley.hudson/profile",
"sub": "ariana.riley.hudson",
"uid": "1sKcrGacQtY",
"updated_at": 1542585600,
"webmail": "https://www.mailinator.com/v3/?zone=public&query=ariana.riley.hudson.VJ2ABXA",
"website": "https://phantauth.net",
"zoneinfo": "America/Chicago"
},
{
"@id": "https://phantauth.net/user/madeline.randall",
"address": {
"country": "UnitedKingdom",
"formatted": "140 Atkins Avenue APT 126\nSan Francisco 48571",
"locality": "San Francisco",
"postal_code": "48571",
"street_address": "140 Atkins Avenue APT 126"
},
"birthdate": "1966-08-28",
"email": "madeline.randall.P545AFI@mailinator.com",
"email_verified": true,
"family_name": "Randall",
"gender": "female",
"given_name": "Madeline",
"locale": "en_GB",
"me": "https://phantauth.net/~madeline.randall",
"name": "Madeline Randall",
"nickname": "Madeline",
"password": "xi89SZWX",
"phone_number": "747-136-9890",
"phone_number_verified": true,
"picture": "https://www.gravatar.com/avatar/eb3bac3d1654c56efbb93645770e5a60?s=256&d=https://avatars.phantauth.net/ai/female/pmbkErez.jpg",
"preferred_username": "mrandall",
"profile": "https://phantauth.net/user/madeline.randall/profile",
"sub": "madeline.randall",
"uid": "5xjXrNaK8eU",
"updated_at": 1535414400,
"webmail": "https://www.mailinator.com/v3/?zone=public&query=madeline.randall.P545AFI",
"website": "https://phantauth.net",
"zoneinfo": "Europe/London"
},
{
"@id": "https://phantauth.net/user/alexa.brooklyn.rollins",
"address": {
"country": "Canada",
"formatted": "104 Herzi Street APT 39\nWashington 22412",
"locality": "Washington",
"postal_code": "22412",
"street_address": "104 Herzi Street APT 39"
},
"birthdate": "1920-02-29",
"email": "alexa.brooklyn.rollins.WHW7KNY@mailinator.com",
"email_verified": false,
"family_name": "Rollins",
"gender": "female",
"given_name": "Alexa",
"locale": "fr_CA",
"me": "https://phantauth.net/~alexa.brooklyn.rollins",
"middle_name": "Brooklyn",
"name": "Alexa Rollins",
"nickname": "Alexa",
"password": "8h3tEVhM",
"phone_number": "335-295-2273",
"phone_number_verified": true,
"picture": "https://www.gravatar.com/avatar/404e4bf6b700625b670d84336fa38d52?s=256&d=https://avatars.phantauth.net/ai/female/pmbkyvez.jpg",
"preferred_username": "arollins",
"profile": "https://phantauth.net/user/alexa.brooklyn.rollins/profile",
"sub": "alexa.brooklyn.rollins",
"uid": "ji7mQ76imjY",
"updated_at": 1519776000,
"webmail": "https://www.mailinator.com/v3/?zone=public&query=alexa.brooklyn.rollins.WHW7KNY",
"website": "https://phantauth.net",
"zoneinfo": "Canada/Central"
},
{
"@id": "https://phantauth.net/user/cameron.barnes",
"address": {
"country": "Australia",
"formatted": "139 Aster Court\nNew York 20333",
"locality": "New York",
"postal_code": "20333",
"street_address": "139 Aster Court"
},
"birthdate": "1960-07-17",
"email": "cameron.barnes.UW4JUXI@mailinator.com",
"email_verified": false,
"family_name": "Barnes",
"gender": "male",
"given_name": "Cameron",
"locale": "en_AU",
"me": "https://phantauth.net/~cameron.barnes",
"name": "Cameron Barnes",
"nickname": "Cameron",
"password": "OL4y4cpb",
"phone_number": "449-465-925",
"phone_number_verified": true,
"picture": "https://www.gravatar.com/avatar/6cc04628ef7fb47eaa9a262b56b61e7d?s=256&d=https://avatars.phantauth.net/ai/male/wdL96rej.jpg",
"preferred_username": "cbarnes",
"profile": "https://phantauth.net/user/cameron.barnes/profile",
"sub": "cameron.barnes",
"uid": "N4DJJyHMhUg",
"updated_at": 1531785600,
"webmail": "https://www.mailinator.com/v3/?zone=public&query=cameron.barnes.UW4JUXI",
"website": "https://phantauth.net",
"zoneinfo": "Australia/Sydney"
},
{
"@id": "https://phantauth.net/user/kayden.abbott",
"address": {
"country": "Canada",
"formatted": "110 Aster Court APT 299\nMiami 16321",
"locality": "Miami",
"postal_code": "16321",
"street_address": "110 Aster Court APT 299"
},
"birthdate": "2016-02-28",
"email": "kayden.abbott.6VBRMHI@mailinator.com",
"email_verified": true,
"family_name": "Abbott",
"gender": "unknown",
"given_name": "Kayden",
"locale": "fr_CA",
"me": "https://phantauth.net/~kayden.abbott",
"name": "Kayden Abbott",
"nickname": "Kayden",
"password": "RUEJG2Vj",
"phone_number": "988-622-6683",
"phone_number_verified": false,
"picture": "https://www.gravatar.com/avatar/0e72d45f96c44213f80f10b593ccba13?s=256&d=https://avatars.phantauth.net/ai/unknown/X7axLPay.jpg",
"preferred_username": "kabbott",
"profile": "https://phantauth.net/user/kayden.abbott/profile",
"sub": "kayden.abbott",
"uid": "VHNoCwU/+LE",
"updated_at": 1519776000,
"webmail": "https://www.mailinator.com/v3/?zone=public&query=kayden.abbott.6VBRMHI",
"website": "https://phantauth.net",
"zoneinfo": "Canada/Central"
}
],
"name": "Dream Team",
"profile": "https://phantauth.net/team/dream.team/profile",
"sub": "dream.team"
}
GET
Get a Tenant
{{baseUrl}}/tenant/:tenantname
QUERY PARAMS
tenantname
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tenant/:tenantname");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/tenant/:tenantname")
require "http/client"
url = "{{baseUrl}}/tenant/:tenantname"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/tenant/:tenantname"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tenant/:tenantname");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tenant/:tenantname"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/tenant/:tenantname HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/tenant/:tenantname")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tenant/:tenantname"))
.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}}/tenant/:tenantname")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/tenant/:tenantname")
.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}}/tenant/:tenantname');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/tenant/:tenantname'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tenant/:tenantname';
const options = {method: 'GET'};
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}}/tenant/:tenantname',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/tenant/:tenantname")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/tenant/:tenantname',
headers: {}
};
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}}/tenant/:tenantname'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/tenant/:tenantname');
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}}/tenant/:tenantname'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tenant/:tenantname';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tenant/:tenantname"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/tenant/:tenantname" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tenant/:tenantname",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/tenant/:tenantname');
echo $response->getBody();
setUrl('{{baseUrl}}/tenant/:tenantname');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/tenant/:tenantname');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tenant/:tenantname' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tenant/:tenantname' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/tenant/:tenantname")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tenant/:tenantname"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tenant/:tenantname"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tenant/:tenantname")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/tenant/:tenantname') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tenant/:tenantname";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/tenant/:tenantname
http GET {{baseUrl}}/tenant/:tenantname
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/tenant/:tenantname
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tenant/:tenantname")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
{
"@id": "https://phantauth.net/_faker/tenant/faker",
"domain": false,
"factories": [
"team",
"user"
],
"factory": "https://faker.phantauth.net/api{/kind,name}",
"flags": "small",
"issuer": "https://phantauth.net/_faker",
"logo": "https://phantauth-faker.now.sh/faker-logo.svg",
"name": "PhantAuth Faker",
"sub": "faker",
"subtenant": false,
"template": "https://default.phantauth.net{/resource}",
"theme": "https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/united/bootstrap.min.css",
"website": "https://phantauth.net/_faker"
}
POST
Create a User Selfie
{{baseUrl}}/user
BODY json
{
"@id": "",
"address": {
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
},
"birthdate": "",
"email": "",
"email_verified": false,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": false,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/user");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/user" {:content-type :json
:form-params {:@id ""
:address {:country ""
:formatted ""
:locality ""
:postal_code ""
:region ""
:street_address ""}
:birthdate ""
:email ""
:email_verified false
:family_name ""
:gender ""
:given_name ""
:locale ""
:me ""
:middle_name ""
:name ""
:nickname ""
:password ""
:phone_number ""
:phone_number_verified false
:picture ""
:preferred_username ""
:profile ""
:sub ""
:uid ""
:updated_at ""
:webmail ""
:website ""
:zoneinfo ""}})
require "http/client"
url = "{{baseUrl}}/user"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/user"),
Content = new StringContent("{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/user");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/user"
payload := strings.NewReader("{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/user HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 594
{
"@id": "",
"address": {
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
},
"birthdate": "",
"email": "",
"email_verified": false,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": false,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/user")
.setHeader("content-type", "application/json")
.setBody("{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/user"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/user")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/user")
.header("content-type", "application/json")
.body("{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}")
.asString();
const data = JSON.stringify({
'@id': '',
address: {
country: '',
formatted: '',
locality: '',
postal_code: '',
region: '',
street_address: ''
},
birthdate: '',
email: '',
email_verified: false,
family_name: '',
gender: '',
given_name: '',
locale: '',
me: '',
middle_name: '',
name: '',
nickname: '',
password: '',
phone_number: '',
phone_number_verified: false,
picture: '',
preferred_username: '',
profile: '',
sub: '',
uid: '',
updated_at: '',
webmail: '',
website: '',
zoneinfo: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/user');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/user',
headers: {'content-type': 'application/json'},
data: {
'@id': '',
address: {
country: '',
formatted: '',
locality: '',
postal_code: '',
region: '',
street_address: ''
},
birthdate: '',
email: '',
email_verified: false,
family_name: '',
gender: '',
given_name: '',
locale: '',
me: '',
middle_name: '',
name: '',
nickname: '',
password: '',
phone_number: '',
phone_number_verified: false,
picture: '',
preferred_username: '',
profile: '',
sub: '',
uid: '',
updated_at: '',
webmail: '',
website: '',
zoneinfo: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/user';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"@id":"","address":{"country":"","formatted":"","locality":"","postal_code":"","region":"","street_address":""},"birthdate":"","email":"","email_verified":false,"family_name":"","gender":"","given_name":"","locale":"","me":"","middle_name":"","name":"","nickname":"","password":"","phone_number":"","phone_number_verified":false,"picture":"","preferred_username":"","profile":"","sub":"","uid":"","updated_at":"","webmail":"","website":"","zoneinfo":""}'
};
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}}/user',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "@id": "",\n "address": {\n "country": "",\n "formatted": "",\n "locality": "",\n "postal_code": "",\n "region": "",\n "street_address": ""\n },\n "birthdate": "",\n "email": "",\n "email_verified": false,\n "family_name": "",\n "gender": "",\n "given_name": "",\n "locale": "",\n "me": "",\n "middle_name": "",\n "name": "",\n "nickname": "",\n "password": "",\n "phone_number": "",\n "phone_number_verified": false,\n "picture": "",\n "preferred_username": "",\n "profile": "",\n "sub": "",\n "uid": "",\n "updated_at": "",\n "webmail": "",\n "website": "",\n "zoneinfo": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/user")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/user',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
'@id': '',
address: {
country: '',
formatted: '',
locality: '',
postal_code: '',
region: '',
street_address: ''
},
birthdate: '',
email: '',
email_verified: false,
family_name: '',
gender: '',
given_name: '',
locale: '',
me: '',
middle_name: '',
name: '',
nickname: '',
password: '',
phone_number: '',
phone_number_verified: false,
picture: '',
preferred_username: '',
profile: '',
sub: '',
uid: '',
updated_at: '',
webmail: '',
website: '',
zoneinfo: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/user',
headers: {'content-type': 'application/json'},
body: {
'@id': '',
address: {
country: '',
formatted: '',
locality: '',
postal_code: '',
region: '',
street_address: ''
},
birthdate: '',
email: '',
email_verified: false,
family_name: '',
gender: '',
given_name: '',
locale: '',
me: '',
middle_name: '',
name: '',
nickname: '',
password: '',
phone_number: '',
phone_number_verified: false,
picture: '',
preferred_username: '',
profile: '',
sub: '',
uid: '',
updated_at: '',
webmail: '',
website: '',
zoneinfo: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/user');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
'@id': '',
address: {
country: '',
formatted: '',
locality: '',
postal_code: '',
region: '',
street_address: ''
},
birthdate: '',
email: '',
email_verified: false,
family_name: '',
gender: '',
given_name: '',
locale: '',
me: '',
middle_name: '',
name: '',
nickname: '',
password: '',
phone_number: '',
phone_number_verified: false,
picture: '',
preferred_username: '',
profile: '',
sub: '',
uid: '',
updated_at: '',
webmail: '',
website: '',
zoneinfo: ''
});
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}}/user',
headers: {'content-type': 'application/json'},
data: {
'@id': '',
address: {
country: '',
formatted: '',
locality: '',
postal_code: '',
region: '',
street_address: ''
},
birthdate: '',
email: '',
email_verified: false,
family_name: '',
gender: '',
given_name: '',
locale: '',
me: '',
middle_name: '',
name: '',
nickname: '',
password: '',
phone_number: '',
phone_number_verified: false,
picture: '',
preferred_username: '',
profile: '',
sub: '',
uid: '',
updated_at: '',
webmail: '',
website: '',
zoneinfo: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/user';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"@id":"","address":{"country":"","formatted":"","locality":"","postal_code":"","region":"","street_address":""},"birthdate":"","email":"","email_verified":false,"family_name":"","gender":"","given_name":"","locale":"","me":"","middle_name":"","name":"","nickname":"","password":"","phone_number":"","phone_number_verified":false,"picture":"","preferred_username":"","profile":"","sub":"","uid":"","updated_at":"","webmail":"","website":"","zoneinfo":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"@id": @"",
@"address": @{ @"country": @"", @"formatted": @"", @"locality": @"", @"postal_code": @"", @"region": @"", @"street_address": @"" },
@"birthdate": @"",
@"email": @"",
@"email_verified": @NO,
@"family_name": @"",
@"gender": @"",
@"given_name": @"",
@"locale": @"",
@"me": @"",
@"middle_name": @"",
@"name": @"",
@"nickname": @"",
@"password": @"",
@"phone_number": @"",
@"phone_number_verified": @NO,
@"picture": @"",
@"preferred_username": @"",
@"profile": @"",
@"sub": @"",
@"uid": @"",
@"updated_at": @"",
@"webmail": @"",
@"website": @"",
@"zoneinfo": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/user"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/user" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/user",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'@id' => '',
'address' => [
'country' => '',
'formatted' => '',
'locality' => '',
'postal_code' => '',
'region' => '',
'street_address' => ''
],
'birthdate' => '',
'email' => '',
'email_verified' => null,
'family_name' => '',
'gender' => '',
'given_name' => '',
'locale' => '',
'me' => '',
'middle_name' => '',
'name' => '',
'nickname' => '',
'password' => '',
'phone_number' => '',
'phone_number_verified' => null,
'picture' => '',
'preferred_username' => '',
'profile' => '',
'sub' => '',
'uid' => '',
'updated_at' => '',
'webmail' => '',
'website' => '',
'zoneinfo' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/user', [
'body' => '{
"@id": "",
"address": {
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
},
"birthdate": "",
"email": "",
"email_verified": false,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": false,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/user');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'@id' => '',
'address' => [
'country' => '',
'formatted' => '',
'locality' => '',
'postal_code' => '',
'region' => '',
'street_address' => ''
],
'birthdate' => '',
'email' => '',
'email_verified' => null,
'family_name' => '',
'gender' => '',
'given_name' => '',
'locale' => '',
'me' => '',
'middle_name' => '',
'name' => '',
'nickname' => '',
'password' => '',
'phone_number' => '',
'phone_number_verified' => null,
'picture' => '',
'preferred_username' => '',
'profile' => '',
'sub' => '',
'uid' => '',
'updated_at' => '',
'webmail' => '',
'website' => '',
'zoneinfo' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'@id' => '',
'address' => [
'country' => '',
'formatted' => '',
'locality' => '',
'postal_code' => '',
'region' => '',
'street_address' => ''
],
'birthdate' => '',
'email' => '',
'email_verified' => null,
'family_name' => '',
'gender' => '',
'given_name' => '',
'locale' => '',
'me' => '',
'middle_name' => '',
'name' => '',
'nickname' => '',
'password' => '',
'phone_number' => '',
'phone_number_verified' => null,
'picture' => '',
'preferred_username' => '',
'profile' => '',
'sub' => '',
'uid' => '',
'updated_at' => '',
'webmail' => '',
'website' => '',
'zoneinfo' => ''
]));
$request->setRequestUrl('{{baseUrl}}/user');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/user' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"@id": "",
"address": {
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
},
"birthdate": "",
"email": "",
"email_verified": false,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": false,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/user' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"@id": "",
"address": {
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
},
"birthdate": "",
"email": "",
"email_verified": false,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": false,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/user", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/user"
payload = {
"@id": "",
"address": {
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
},
"birthdate": "",
"email": "",
"email_verified": False,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": False,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/user"
payload <- "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/user') do |req|
req.body = "{\n \"@id\": \"\",\n \"address\": {\n \"country\": \"\",\n \"formatted\": \"\",\n \"locality\": \"\",\n \"postal_code\": \"\",\n \"region\": \"\",\n \"street_address\": \"\"\n },\n \"birthdate\": \"\",\n \"email\": \"\",\n \"email_verified\": false,\n \"family_name\": \"\",\n \"gender\": \"\",\n \"given_name\": \"\",\n \"locale\": \"\",\n \"me\": \"\",\n \"middle_name\": \"\",\n \"name\": \"\",\n \"nickname\": \"\",\n \"password\": \"\",\n \"phone_number\": \"\",\n \"phone_number_verified\": false,\n \"picture\": \"\",\n \"preferred_username\": \"\",\n \"profile\": \"\",\n \"sub\": \"\",\n \"uid\": \"\",\n \"updated_at\": \"\",\n \"webmail\": \"\",\n \"website\": \"\",\n \"zoneinfo\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/user";
let payload = json!({
"@id": "",
"address": json!({
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
}),
"birthdate": "",
"email": "",
"email_verified": false,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": false,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/user \
--header 'content-type: application/json' \
--data '{
"@id": "",
"address": {
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
},
"birthdate": "",
"email": "",
"email_verified": false,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": false,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
}'
echo '{
"@id": "",
"address": {
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
},
"birthdate": "",
"email": "",
"email_verified": false,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": false,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
}' | \
http POST {{baseUrl}}/user \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "@id": "",\n "address": {\n "country": "",\n "formatted": "",\n "locality": "",\n "postal_code": "",\n "region": "",\n "street_address": ""\n },\n "birthdate": "",\n "email": "",\n "email_verified": false,\n "family_name": "",\n "gender": "",\n "given_name": "",\n "locale": "",\n "me": "",\n "middle_name": "",\n "name": "",\n "nickname": "",\n "password": "",\n "phone_number": "",\n "phone_number_verified": false,\n "picture": "",\n "preferred_username": "",\n "profile": "",\n "sub": "",\n "uid": "",\n "updated_at": "",\n "webmail": "",\n "website": "",\n "zoneinfo": ""\n}' \
--output-document \
- {{baseUrl}}/user
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"@id": "",
"address": [
"country": "",
"formatted": "",
"locality": "",
"postal_code": "",
"region": "",
"street_address": ""
],
"birthdate": "",
"email": "",
"email_verified": false,
"family_name": "",
"gender": "",
"given_name": "",
"locale": "",
"me": "",
"middle_name": "",
"name": "",
"nickname": "",
"password": "",
"phone_number": "",
"phone_number_verified": false,
"picture": "",
"preferred_username": "",
"profile": "",
"sub": "",
"uid": "",
"updated_at": "",
"webmail": "",
"website": "",
"zoneinfo": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/user")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
text/plain
RESPONSE BODY text
eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..3FlrxAUU5W8t31Rw.2JMhWkDz4aTGnvo4f2T5htzwwtzaUYbNzDZ4zAiqCepjhM5IX6pZMDQohr2M3u5liARhiObS1j1wlpNRdYz6YIDaLNZoRwHml-5LY8s8_1lgC4EQqAag3z9qrCoxc4LCkinruwQAeYuFiGq0YB6pp2FzQKDYh41RA_t3sgqsKAPG3Ql7X_Z0NMa0wMaBYxTLHn-lPbZOSWu3-nQzNQ8652HuBDY3JubCt_0hOBGCuhjrIX1fmq8RJb61pNFvWuJ8CHhx6fAoWi0hCETkYJ27gnrOy_jiPIThcyLrB7pouQ9Xs9xXtPdumfRScX7zx-kE9j_RyJ-HEG7WLBZkKJSHfqMCKB3dVxVdJ6DE3cYkADBb7J_8YLOKgMv1Jiw9yEZjoTQ39LtPBVCsubLPuI3k1SrYvZchNfJWbkFr9YlB46UzTnkt3VYvPfstLYXpYl--o9UIbZMM2wtyi24Szoq-GvPtNRXLvAZt2QeMB8ZGqPC7DcCgs4pba4X1uS0b_-oyjmI1azCve-5ov5UQZ9VRjBiVf3IlMFs2276A5hsxm-x-JcspBD4T83iSzObEnYM5gVX2FLD_QPt61TYknufuSkFyhgSyM8Zw4s1L4zLCljEqtGWFzOg3KrpKH7b4NQN1nuY2NEkhVrrAKZJeUM55KMRXdBTXTUOyWk2hObZs325_2F9mjYE1QTnGHHhuzFLT0uRxxf1HmcguzTfeorwk626Ed_VtSDygH0wbHuV7YOlt6VYkuEknzqS62NINPNkuvCKmkBjl1tIeCaaXXMb_fVcTL-9rueG9YxY4RpX0tvPN25zwuj3wXiEh11YlUnmD3zFh3QoKbJ0GQc8Xc5z0vj59NXMPQUC36xQ0O7KVIY7uKYbKVf71wtKY2rq4sYuWbm0vdOiab0lzvYv3-R5v79KPuq03AyPZeWOfmSPpnTRo4WA6geXID-KAEFkboL_SxHU7r--MpqL2tFeF7nS2IFNYjRchr19LWqZ9bvXtEyfsiqgQAzPmGOQ.QPl0yBPkyUxlb7WuxcOmeA
GET
Get a User Token
{{baseUrl}}/user/:username/token/:kind
QUERY PARAMS
username
kind
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/user/:username/token/:kind");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/user/:username/token/:kind")
require "http/client"
url = "{{baseUrl}}/user/:username/token/:kind"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/user/:username/token/:kind"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/user/:username/token/:kind");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/user/:username/token/:kind"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/user/:username/token/:kind HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/user/:username/token/:kind")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/user/:username/token/:kind"))
.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}}/user/:username/token/:kind")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/user/:username/token/:kind")
.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}}/user/:username/token/:kind');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/user/:username/token/:kind'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/user/:username/token/:kind';
const options = {method: 'GET'};
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}}/user/:username/token/:kind',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/user/:username/token/:kind")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/user/:username/token/:kind',
headers: {}
};
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}}/user/:username/token/:kind'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/user/:username/token/:kind');
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}}/user/:username/token/:kind'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/user/:username/token/:kind';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/user/:username/token/:kind"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/user/:username/token/:kind" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/user/:username/token/:kind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/user/:username/token/:kind');
echo $response->getBody();
setUrl('{{baseUrl}}/user/:username/token/:kind');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/user/:username/token/:kind');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/user/:username/token/:kind' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/user/:username/token/:kind' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/user/:username/token/:kind")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/user/:username/token/:kind"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/user/:username/token/:kind"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/user/:username/token/:kind")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/user/:username/token/:kind') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/user/:username/token/:kind";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/user/:username/token/:kind
http GET {{baseUrl}}/user/:username/token/:kind
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/user/:username/token/:kind
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/user/:username/token/:kind")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
text/plain
RESPONSE BODY text
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJqb3NoLnNtaXRoIiwidG9rZW5fa2luZCI6IkFDQ0VTUyIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwgYWRkcmVzcyBwaG9uZSBpbmRpZWF1dGggdWlkIiwiZXhwIjoxNTU2ODg5NzcxLCJpYXQiOjE1NTY4ODkxNzF9.YBQ_6GlQ1iXjk6OKU7meJhlg3iRDEgeTqnBFdeLDJyI
GET
Get a User
{{baseUrl}}/user/:username
QUERY PARAMS
username
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/user/:username");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/user/:username")
require "http/client"
url = "{{baseUrl}}/user/:username"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/user/:username"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/user/:username");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/user/:username"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/user/:username HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/user/:username")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/user/:username"))
.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}}/user/:username")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/user/:username")
.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}}/user/:username');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/user/:username'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/user/:username';
const options = {method: 'GET'};
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}}/user/:username',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/user/:username")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/user/:username',
headers: {}
};
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}}/user/:username'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/user/:username');
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}}/user/:username'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/user/:username';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/user/:username"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/user/:username" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/user/:username",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/user/:username');
echo $response->getBody();
setUrl('{{baseUrl}}/user/:username');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/user/:username');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/user/:username' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/user/:username' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/user/:username")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/user/:username"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/user/:username"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/user/:username")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/user/:username') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/user/:username";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/user/:username
http GET {{baseUrl}}/user/:username
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/user/:username
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/user/:username")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
{
"@id": "https://phantauth.net/user/john.smith",
"address": {
"country": "USA",
"formatted": "160 Washington Walk\nSan Francisco 98239",
"locality": "San Francisco",
"postal_code": "98239",
"street_address": "160 Washington Walk"
},
"birthdate": "1950-02-10",
"email": "john.smith.XPKEFHI@mailinator.com",
"email_verified": false,
"family_name": "Smith",
"gender": "male",
"given_name": "John",
"locale": "en_US",
"me": "https://phantauth.net/~john.smith",
"name": "John Smith",
"nickname": "John",
"password": "Opha8TV2",
"phone_number": "747-178-7374",
"phone_number_verified": true,
"picture": "https://www.gravatar.com/avatar/54c27dd1891df67163ef53616549933f?s=256&d=https://avatars.phantauth.net/ai/male/Vyb8Yrdv.jpg",
"preferred_username": "jsmith",
"profile": "https://phantauth.net/user/john.smith/profile",
"sub": "john.smith",
"uid": "tf+gMsdUWj0",
"updated_at": 1518220800,
"webmail": "https://www.mailinator.com/v3/?zone=public&query=john.smith.XPKEFHI",
"website": "https://phantauth.net",
"zoneinfo": "America/Chicago"
}