PowerTools Developer
POST
Collections - Add to collection
{{baseUrl}}/AddToCollection
BODY json
{
"index": "",
"input": [],
"item": "",
"items": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/AddToCollection");
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 \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/AddToCollection" {:content-type :json
:form-params {:index ""
:input []
:item ""
:items []}})
require "http/client"
url = "{{baseUrl}}/AddToCollection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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}}/AddToCollection"),
Content = new StringContent("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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}}/AddToCollection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/AddToCollection"
payload := strings.NewReader("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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/AddToCollection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 61
{
"index": "",
"input": [],
"item": "",
"items": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/AddToCollection")
.setHeader("content-type", "application/json")
.setBody("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/AddToCollection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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 \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/AddToCollection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/AddToCollection")
.header("content-type", "application/json")
.body("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}")
.asString();
const data = JSON.stringify({
index: '',
input: [],
item: '',
items: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/AddToCollection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/AddToCollection',
headers: {'content-type': 'application/json'},
data: {index: '', input: [], item: '', items: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/AddToCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"index":"","input":[],"item":"","items":[]}'
};
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}}/AddToCollection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "index": "",\n "input": [],\n "item": "",\n "items": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/AddToCollection")
.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/AddToCollection',
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({index: '', input: [], item: '', items: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/AddToCollection',
headers: {'content-type': 'application/json'},
body: {index: '', input: [], item: '', items: []},
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}}/AddToCollection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
index: '',
input: [],
item: '',
items: []
});
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}}/AddToCollection',
headers: {'content-type': 'application/json'},
data: {index: '', input: [], item: '', items: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/AddToCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"index":"","input":[],"item":"","items":[]}'
};
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 = @{ @"index": @"",
@"input": @[ ],
@"item": @"",
@"items": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/AddToCollection"]
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}}/AddToCollection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/AddToCollection",
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([
'index' => '',
'input' => [
],
'item' => '',
'items' => [
]
]),
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}}/AddToCollection', [
'body' => '{
"index": "",
"input": [],
"item": "",
"items": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/AddToCollection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'index' => '',
'input' => [
],
'item' => '',
'items' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'index' => '',
'input' => [
],
'item' => '',
'items' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/AddToCollection');
$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}}/AddToCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"index": "",
"input": [],
"item": "",
"items": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/AddToCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"index": "",
"input": [],
"item": "",
"items": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/AddToCollection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/AddToCollection"
payload = {
"index": "",
"input": [],
"item": "",
"items": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/AddToCollection"
payload <- "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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}}/AddToCollection")
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 \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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/AddToCollection') do |req|
req.body = "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/AddToCollection";
let payload = json!({
"index": "",
"input": (),
"item": "",
"items": ()
});
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}}/AddToCollection \
--header 'content-type: application/json' \
--data '{
"index": "",
"input": [],
"item": "",
"items": []
}'
echo '{
"index": "",
"input": [],
"item": "",
"items": []
}' | \
http POST {{baseUrl}}/AddToCollection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "index": "",\n "input": [],\n "item": "",\n "items": []\n}' \
--output-document \
- {{baseUrl}}/AddToCollection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"index": "",
"input": [],
"item": "",
"items": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/AddToCollection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": [
"a",
"b",
"c"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Collection to JSON
{{baseUrl}}/CollectionToJSON
BODY json
{
"input": [],
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CollectionToJSON");
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 \"input\": [],\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CollectionToJSON" {:content-type :json
:form-params {:input []
:name ""}})
require "http/client"
url = "{{baseUrl}}/CollectionToJSON"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": [],\n \"name\": \"\"\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}}/CollectionToJSON"),
Content = new StringContent("{\n \"input\": [],\n \"name\": \"\"\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}}/CollectionToJSON");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": [],\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CollectionToJSON"
payload := strings.NewReader("{\n \"input\": [],\n \"name\": \"\"\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/CollectionToJSON HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 31
{
"input": [],
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CollectionToJSON")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": [],\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CollectionToJSON"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": [],\n \"name\": \"\"\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 \"input\": [],\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CollectionToJSON")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CollectionToJSON")
.header("content-type", "application/json")
.body("{\n \"input\": [],\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: [],
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CollectionToJSON');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionToJSON',
headers: {'content-type': 'application/json'},
data: {input: [], name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CollectionToJSON';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"name":""}'
};
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}}/CollectionToJSON',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": [],\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": [],\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CollectionToJSON")
.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/CollectionToJSON',
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({input: [], name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionToJSON',
headers: {'content-type': 'application/json'},
body: {input: [], name: ''},
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}}/CollectionToJSON');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: [],
name: ''
});
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}}/CollectionToJSON',
headers: {'content-type': 'application/json'},
data: {input: [], name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CollectionToJSON';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"name":""}'
};
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 = @{ @"input": @[ ],
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CollectionToJSON"]
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}}/CollectionToJSON" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": [],\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CollectionToJSON",
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([
'input' => [
],
'name' => ''
]),
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}}/CollectionToJSON', [
'body' => '{
"input": [],
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CollectionToJSON');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => [
],
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => [
],
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CollectionToJSON');
$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}}/CollectionToJSON' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CollectionToJSON' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": [],\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CollectionToJSON", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CollectionToJSON"
payload = {
"input": [],
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CollectionToJSON"
payload <- "{\n \"input\": [],\n \"name\": \"\"\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}}/CollectionToJSON")
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 \"input\": [],\n \"name\": \"\"\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/CollectionToJSON') do |req|
req.body = "{\n \"input\": [],\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CollectionToJSON";
let payload = json!({
"input": (),
"name": ""
});
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}}/CollectionToJSON \
--header 'content-type: application/json' \
--data '{
"input": [],
"name": ""
}'
echo '{
"input": [],
"name": ""
}' | \
http POST {{baseUrl}}/CollectionToJSON \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": [],\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/CollectionToJSON
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": [],
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CollectionToJSON")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Collection to XML
{{baseUrl}}/CollectionToXML
BODY json
{
"child": "",
"input": [],
"root": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CollectionToXML");
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 \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CollectionToXML" {:content-type :json
:form-params {:child ""
:input []
:root ""}})
require "http/client"
url = "{{baseUrl}}/CollectionToXML"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\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}}/CollectionToXML"),
Content = new StringContent("{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\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}}/CollectionToXML");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CollectionToXML"
payload := strings.NewReader("{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\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/CollectionToXML HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"child": "",
"input": [],
"root": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CollectionToXML")
.setHeader("content-type", "application/json")
.setBody("{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CollectionToXML"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\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 \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CollectionToXML")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CollectionToXML")
.header("content-type", "application/json")
.body("{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\n}")
.asString();
const data = JSON.stringify({
child: '',
input: [],
root: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CollectionToXML');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionToXML',
headers: {'content-type': 'application/json'},
data: {child: '', input: [], root: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CollectionToXML';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"child":"","input":[],"root":""}'
};
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}}/CollectionToXML',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "child": "",\n "input": [],\n "root": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CollectionToXML")
.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/CollectionToXML',
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({child: '', input: [], root: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionToXML',
headers: {'content-type': 'application/json'},
body: {child: '', input: [], root: ''},
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}}/CollectionToXML');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
child: '',
input: [],
root: ''
});
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}}/CollectionToXML',
headers: {'content-type': 'application/json'},
data: {child: '', input: [], root: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CollectionToXML';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"child":"","input":[],"root":""}'
};
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 = @{ @"child": @"",
@"input": @[ ],
@"root": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CollectionToXML"]
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}}/CollectionToXML" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CollectionToXML",
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([
'child' => '',
'input' => [
],
'root' => ''
]),
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}}/CollectionToXML', [
'body' => '{
"child": "",
"input": [],
"root": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CollectionToXML');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'child' => '',
'input' => [
],
'root' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'child' => '',
'input' => [
],
'root' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CollectionToXML');
$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}}/CollectionToXML' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"child": "",
"input": [],
"root": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CollectionToXML' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"child": "",
"input": [],
"root": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CollectionToXML", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CollectionToXML"
payload = {
"child": "",
"input": [],
"root": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CollectionToXML"
payload <- "{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\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}}/CollectionToXML")
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 \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\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/CollectionToXML') do |req|
req.body = "{\n \"child\": \"\",\n \"input\": [],\n \"root\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CollectionToXML";
let payload = json!({
"child": "",
"input": (),
"root": ""
});
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}}/CollectionToXML \
--header 'content-type: application/json' \
--data '{
"child": "",
"input": [],
"root": ""
}'
echo '{
"child": "",
"input": [],
"root": ""
}' | \
http POST {{baseUrl}}/CollectionToXML \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "child": "",\n "input": [],\n "root": ""\n}' \
--output-document \
- {{baseUrl}}/CollectionToXML
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"child": "",
"input": [],
"root": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CollectionToXML")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Contains number
{{baseUrl}}/CollectionContainsNumber
BODY json
{
"input": [],
"match": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CollectionContainsNumber");
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 \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CollectionContainsNumber" {:content-type :json
:form-params {:input []
:match ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/CollectionContainsNumber"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\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}}/CollectionContainsNumber"),
Content = new StringContent("{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\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}}/CollectionContainsNumber");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CollectionContainsNumber"
payload := strings.NewReader("{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\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/CollectionContainsNumber HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"input": [],
"match": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CollectionContainsNumber")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CollectionContainsNumber"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\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 \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CollectionContainsNumber")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CollectionContainsNumber")
.header("content-type", "application/json")
.body("{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: [],
match: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CollectionContainsNumber');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionContainsNumber',
headers: {'content-type': 'application/json'},
data: {input: [], match: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CollectionContainsNumber';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"match":"","type":""}'
};
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}}/CollectionContainsNumber',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": [],\n "match": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CollectionContainsNumber")
.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/CollectionContainsNumber',
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({input: [], match: '', type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionContainsNumber',
headers: {'content-type': 'application/json'},
body: {input: [], match: '', type: ''},
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}}/CollectionContainsNumber');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: [],
match: '',
type: ''
});
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}}/CollectionContainsNumber',
headers: {'content-type': 'application/json'},
data: {input: [], match: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CollectionContainsNumber';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"match":"","type":""}'
};
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 = @{ @"input": @[ ],
@"match": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CollectionContainsNumber"]
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}}/CollectionContainsNumber" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CollectionContainsNumber",
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([
'input' => [
],
'match' => '',
'type' => ''
]),
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}}/CollectionContainsNumber', [
'body' => '{
"input": [],
"match": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CollectionContainsNumber');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => [
],
'match' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => [
],
'match' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CollectionContainsNumber');
$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}}/CollectionContainsNumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"match": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CollectionContainsNumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"match": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CollectionContainsNumber", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CollectionContainsNumber"
payload = {
"input": [],
"match": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CollectionContainsNumber"
payload <- "{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\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}}/CollectionContainsNumber")
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 \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\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/CollectionContainsNumber') do |req|
req.body = "{\n \"input\": [],\n \"match\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CollectionContainsNumber";
let payload = json!({
"input": (),
"match": "",
"type": ""
});
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}}/CollectionContainsNumber \
--header 'content-type: application/json' \
--data '{
"input": [],
"match": "",
"type": ""
}'
echo '{
"input": [],
"match": "",
"type": ""
}' | \
http POST {{baseUrl}}/CollectionContainsNumber \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": [],\n "match": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/CollectionContainsNumber
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": [],
"match": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CollectionContainsNumber")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"item": 1.25,
"items": [
1.25,
2.5,
3.75
],
"status": false
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Contains string
{{baseUrl}}/CollectionContainsString
BODY json
{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CollectionContainsString");
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 \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CollectionContainsString" {:content-type :json
:form-params {:ignorecase ""
:input []
:match ""
:trim ""}})
require "http/client"
url = "{{baseUrl}}/CollectionContainsString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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}}/CollectionContainsString"),
Content = new StringContent("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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}}/CollectionContainsString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CollectionContainsString"
payload := strings.NewReader("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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/CollectionContainsString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 66
{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CollectionContainsString")
.setHeader("content-type", "application/json")
.setBody("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CollectionContainsString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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 \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CollectionContainsString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CollectionContainsString")
.header("content-type", "application/json")
.body("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}")
.asString();
const data = JSON.stringify({
ignorecase: '',
input: [],
match: '',
trim: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CollectionContainsString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionContainsString',
headers: {'content-type': 'application/json'},
data: {ignorecase: '', input: [], match: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CollectionContainsString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignorecase":"","input":[],"match":"","trim":""}'
};
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}}/CollectionContainsString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ignorecase": "",\n "input": [],\n "match": "",\n "trim": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CollectionContainsString")
.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/CollectionContainsString',
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({ignorecase: '', input: [], match: '', trim: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionContainsString',
headers: {'content-type': 'application/json'},
body: {ignorecase: '', input: [], match: '', trim: ''},
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}}/CollectionContainsString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ignorecase: '',
input: [],
match: '',
trim: ''
});
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}}/CollectionContainsString',
headers: {'content-type': 'application/json'},
data: {ignorecase: '', input: [], match: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CollectionContainsString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignorecase":"","input":[],"match":"","trim":""}'
};
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 = @{ @"ignorecase": @"",
@"input": @[ ],
@"match": @"",
@"trim": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CollectionContainsString"]
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}}/CollectionContainsString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CollectionContainsString",
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([
'ignorecase' => '',
'input' => [
],
'match' => '',
'trim' => ''
]),
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}}/CollectionContainsString', [
'body' => '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CollectionContainsString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ignorecase' => '',
'input' => [
],
'match' => '',
'trim' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ignorecase' => '',
'input' => [
],
'match' => '',
'trim' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CollectionContainsString');
$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}}/CollectionContainsString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CollectionContainsString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CollectionContainsString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CollectionContainsString"
payload = {
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CollectionContainsString"
payload <- "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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}}/CollectionContainsString")
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 \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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/CollectionContainsString') do |req|
req.body = "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CollectionContainsString";
let payload = json!({
"ignorecase": "",
"input": (),
"match": "",
"trim": ""
});
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}}/CollectionContainsString \
--header 'content-type: application/json' \
--data '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}'
echo '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}' | \
http POST {{baseUrl}}/CollectionContainsString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ignorecase": "",\n "input": [],\n "match": "",\n "trim": ""\n}' \
--output-document \
- {{baseUrl}}/CollectionContainsString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CollectionContainsString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"item": "string",
"items": [
"string"
],
"status": false
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Count collection
{{baseUrl}}/CountCollection
BODY json
{
"input": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CountCollection");
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 \"input\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CountCollection" {:content-type :json
:form-params {:input []}})
require "http/client"
url = "{{baseUrl}}/CountCollection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": []\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}}/CountCollection"),
Content = new StringContent("{\n \"input\": []\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}}/CountCollection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CountCollection"
payload := strings.NewReader("{\n \"input\": []\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/CountCollection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 17
{
"input": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CountCollection")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CountCollection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": []\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 \"input\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CountCollection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CountCollection")
.header("content-type", "application/json")
.body("{\n \"input\": []\n}")
.asString();
const data = JSON.stringify({
input: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CountCollection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CountCollection',
headers: {'content-type': 'application/json'},
data: {input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CountCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[]}'
};
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}}/CountCollection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CountCollection")
.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/CountCollection',
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({input: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CountCollection',
headers: {'content-type': 'application/json'},
body: {input: []},
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}}/CountCollection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: []
});
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}}/CountCollection',
headers: {'content-type': 'application/json'},
data: {input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CountCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[]}'
};
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 = @{ @"input": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CountCollection"]
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}}/CountCollection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CountCollection",
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([
'input' => [
]
]),
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}}/CountCollection', [
'body' => '{
"input": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CountCollection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/CountCollection');
$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}}/CountCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CountCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CountCollection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CountCollection"
payload = { "input": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CountCollection"
payload <- "{\n \"input\": []\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}}/CountCollection")
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 \"input\": []\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/CountCollection') do |req|
req.body = "{\n \"input\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CountCollection";
let payload = json!({"input": ()});
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}}/CountCollection \
--header 'content-type: application/json' \
--data '{
"input": []
}'
echo '{
"input": []
}' | \
http POST {{baseUrl}}/CountCollection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": []\n}' \
--output-document \
- {{baseUrl}}/CountCollection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["input": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CountCollection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Ends with string
{{baseUrl}}/CollectionEndsWithString
BODY json
{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CollectionEndsWithString");
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 \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CollectionEndsWithString" {:content-type :json
:form-params {:ignorecase ""
:input []
:match ""
:trim ""}})
require "http/client"
url = "{{baseUrl}}/CollectionEndsWithString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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}}/CollectionEndsWithString"),
Content = new StringContent("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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}}/CollectionEndsWithString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CollectionEndsWithString"
payload := strings.NewReader("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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/CollectionEndsWithString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 66
{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CollectionEndsWithString")
.setHeader("content-type", "application/json")
.setBody("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CollectionEndsWithString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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 \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CollectionEndsWithString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CollectionEndsWithString")
.header("content-type", "application/json")
.body("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}")
.asString();
const data = JSON.stringify({
ignorecase: '',
input: [],
match: '',
trim: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CollectionEndsWithString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionEndsWithString',
headers: {'content-type': 'application/json'},
data: {ignorecase: '', input: [], match: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CollectionEndsWithString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignorecase":"","input":[],"match":"","trim":""}'
};
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}}/CollectionEndsWithString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ignorecase": "",\n "input": [],\n "match": "",\n "trim": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CollectionEndsWithString")
.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/CollectionEndsWithString',
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({ignorecase: '', input: [], match: '', trim: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionEndsWithString',
headers: {'content-type': 'application/json'},
body: {ignorecase: '', input: [], match: '', trim: ''},
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}}/CollectionEndsWithString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ignorecase: '',
input: [],
match: '',
trim: ''
});
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}}/CollectionEndsWithString',
headers: {'content-type': 'application/json'},
data: {ignorecase: '', input: [], match: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CollectionEndsWithString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignorecase":"","input":[],"match":"","trim":""}'
};
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 = @{ @"ignorecase": @"",
@"input": @[ ],
@"match": @"",
@"trim": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CollectionEndsWithString"]
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}}/CollectionEndsWithString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CollectionEndsWithString",
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([
'ignorecase' => '',
'input' => [
],
'match' => '',
'trim' => ''
]),
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}}/CollectionEndsWithString', [
'body' => '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CollectionEndsWithString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ignorecase' => '',
'input' => [
],
'match' => '',
'trim' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ignorecase' => '',
'input' => [
],
'match' => '',
'trim' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CollectionEndsWithString');
$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}}/CollectionEndsWithString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CollectionEndsWithString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CollectionEndsWithString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CollectionEndsWithString"
payload = {
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CollectionEndsWithString"
payload <- "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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}}/CollectionEndsWithString")
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 \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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/CollectionEndsWithString') do |req|
req.body = "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CollectionEndsWithString";
let payload = json!({
"ignorecase": "",
"input": (),
"match": "",
"trim": ""
});
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}}/CollectionEndsWithString \
--header 'content-type: application/json' \
--data '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}'
echo '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}' | \
http POST {{baseUrl}}/CollectionEndsWithString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ignorecase": "",\n "input": [],\n "match": "",\n "trim": ""\n}' \
--output-document \
- {{baseUrl}}/CollectionEndsWithString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CollectionEndsWithString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"item": "string",
"items": [
"string"
],
"status": false
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Filter collection
{{baseUrl}}/FilterCollection
BODY json
{
"input": [],
"keywords": "",
"match": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/FilterCollection");
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 \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/FilterCollection" {:content-type :json
:form-params {:input []
:keywords ""
:match ""}})
require "http/client"
url = "{{baseUrl}}/FilterCollection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\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}}/FilterCollection"),
Content = new StringContent("{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\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}}/FilterCollection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/FilterCollection"
payload := strings.NewReader("{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\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/FilterCollection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"input": [],
"keywords": "",
"match": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/FilterCollection")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/FilterCollection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\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 \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/FilterCollection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/FilterCollection")
.header("content-type", "application/json")
.body("{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: [],
keywords: '',
match: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/FilterCollection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/FilterCollection',
headers: {'content-type': 'application/json'},
data: {input: [], keywords: '', match: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/FilterCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"keywords":"","match":""}'
};
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}}/FilterCollection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": [],\n "keywords": "",\n "match": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/FilterCollection")
.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/FilterCollection',
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({input: [], keywords: '', match: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/FilterCollection',
headers: {'content-type': 'application/json'},
body: {input: [], keywords: '', match: ''},
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}}/FilterCollection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: [],
keywords: '',
match: ''
});
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}}/FilterCollection',
headers: {'content-type': 'application/json'},
data: {input: [], keywords: '', match: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/FilterCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"keywords":"","match":""}'
};
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 = @{ @"input": @[ ],
@"keywords": @"",
@"match": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/FilterCollection"]
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}}/FilterCollection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/FilterCollection",
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([
'input' => [
],
'keywords' => '',
'match' => ''
]),
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}}/FilterCollection', [
'body' => '{
"input": [],
"keywords": "",
"match": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/FilterCollection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => [
],
'keywords' => '',
'match' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => [
],
'keywords' => '',
'match' => ''
]));
$request->setRequestUrl('{{baseUrl}}/FilterCollection');
$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}}/FilterCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"keywords": "",
"match": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/FilterCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"keywords": "",
"match": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/FilterCollection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/FilterCollection"
payload = {
"input": [],
"keywords": "",
"match": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/FilterCollection"
payload <- "{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\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}}/FilterCollection")
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 \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\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/FilterCollection') do |req|
req.body = "{\n \"input\": [],\n \"keywords\": \"\",\n \"match\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/FilterCollection";
let payload = json!({
"input": (),
"keywords": "",
"match": ""
});
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}}/FilterCollection \
--header 'content-type: application/json' \
--data '{
"input": [],
"keywords": "",
"match": ""
}'
echo '{
"input": [],
"keywords": "",
"match": ""
}' | \
http POST {{baseUrl}}/FilterCollection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": [],\n "keywords": "",\n "match": ""\n}' \
--output-document \
- {{baseUrl}}/FilterCollection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": [],
"keywords": "",
"match": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/FilterCollection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": [
"a",
"b",
"c"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Remove from collection
{{baseUrl}}/RemoveFromCollection
BODY json
{
"index": "",
"input": [],
"item": "",
"items": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/RemoveFromCollection");
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 \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/RemoveFromCollection" {:content-type :json
:form-params {:index ""
:input []
:item ""
:items []}})
require "http/client"
url = "{{baseUrl}}/RemoveFromCollection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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}}/RemoveFromCollection"),
Content = new StringContent("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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}}/RemoveFromCollection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/RemoveFromCollection"
payload := strings.NewReader("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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/RemoveFromCollection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 61
{
"index": "",
"input": [],
"item": "",
"items": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/RemoveFromCollection")
.setHeader("content-type", "application/json")
.setBody("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/RemoveFromCollection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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 \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/RemoveFromCollection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/RemoveFromCollection")
.header("content-type", "application/json")
.body("{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}")
.asString();
const data = JSON.stringify({
index: '',
input: [],
item: '',
items: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/RemoveFromCollection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/RemoveFromCollection',
headers: {'content-type': 'application/json'},
data: {index: '', input: [], item: '', items: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/RemoveFromCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"index":"","input":[],"item":"","items":[]}'
};
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}}/RemoveFromCollection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "index": "",\n "input": [],\n "item": "",\n "items": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/RemoveFromCollection")
.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/RemoveFromCollection',
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({index: '', input: [], item: '', items: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/RemoveFromCollection',
headers: {'content-type': 'application/json'},
body: {index: '', input: [], item: '', items: []},
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}}/RemoveFromCollection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
index: '',
input: [],
item: '',
items: []
});
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}}/RemoveFromCollection',
headers: {'content-type': 'application/json'},
data: {index: '', input: [], item: '', items: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/RemoveFromCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"index":"","input":[],"item":"","items":[]}'
};
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 = @{ @"index": @"",
@"input": @[ ],
@"item": @"",
@"items": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/RemoveFromCollection"]
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}}/RemoveFromCollection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/RemoveFromCollection",
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([
'index' => '',
'input' => [
],
'item' => '',
'items' => [
]
]),
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}}/RemoveFromCollection', [
'body' => '{
"index": "",
"input": [],
"item": "",
"items": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/RemoveFromCollection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'index' => '',
'input' => [
],
'item' => '',
'items' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'index' => '',
'input' => [
],
'item' => '',
'items' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/RemoveFromCollection');
$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}}/RemoveFromCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"index": "",
"input": [],
"item": "",
"items": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/RemoveFromCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"index": "",
"input": [],
"item": "",
"items": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/RemoveFromCollection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/RemoveFromCollection"
payload = {
"index": "",
"input": [],
"item": "",
"items": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/RemoveFromCollection"
payload <- "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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}}/RemoveFromCollection")
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 \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\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/RemoveFromCollection') do |req|
req.body = "{\n \"index\": \"\",\n \"input\": [],\n \"item\": \"\",\n \"items\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/RemoveFromCollection";
let payload = json!({
"index": "",
"input": (),
"item": "",
"items": ()
});
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}}/RemoveFromCollection \
--header 'content-type: application/json' \
--data '{
"index": "",
"input": [],
"item": "",
"items": []
}'
echo '{
"index": "",
"input": [],
"item": "",
"items": []
}' | \
http POST {{baseUrl}}/RemoveFromCollection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "index": "",\n "input": [],\n "item": "",\n "items": []\n}' \
--output-document \
- {{baseUrl}}/RemoveFromCollection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"index": "",
"input": [],
"item": "",
"items": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/RemoveFromCollection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": [
"a",
"b",
"c"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Replace values in collection
{{baseUrl}}/ReplaceValuesInCollection
BODY json
{
"ignoreCase": "",
"input": [],
"match": "",
"replacement": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ReplaceValuesInCollection");
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 \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ReplaceValuesInCollection" {:content-type :json
:form-params {:ignoreCase ""
:input []
:match ""
:replacement ""}})
require "http/client"
url = "{{baseUrl}}/ReplaceValuesInCollection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\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}}/ReplaceValuesInCollection"),
Content = new StringContent("{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\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}}/ReplaceValuesInCollection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ReplaceValuesInCollection"
payload := strings.NewReader("{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\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/ReplaceValuesInCollection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 73
{
"ignoreCase": "",
"input": [],
"match": "",
"replacement": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ReplaceValuesInCollection")
.setHeader("content-type", "application/json")
.setBody("{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ReplaceValuesInCollection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\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 \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ReplaceValuesInCollection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ReplaceValuesInCollection")
.header("content-type", "application/json")
.body("{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\n}")
.asString();
const data = JSON.stringify({
ignoreCase: '',
input: [],
match: '',
replacement: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ReplaceValuesInCollection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ReplaceValuesInCollection',
headers: {'content-type': 'application/json'},
data: {ignoreCase: '', input: [], match: '', replacement: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ReplaceValuesInCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignoreCase":"","input":[],"match":"","replacement":""}'
};
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}}/ReplaceValuesInCollection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ignoreCase": "",\n "input": [],\n "match": "",\n "replacement": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ReplaceValuesInCollection")
.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/ReplaceValuesInCollection',
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({ignoreCase: '', input: [], match: '', replacement: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ReplaceValuesInCollection',
headers: {'content-type': 'application/json'},
body: {ignoreCase: '', input: [], match: '', replacement: ''},
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}}/ReplaceValuesInCollection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ignoreCase: '',
input: [],
match: '',
replacement: ''
});
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}}/ReplaceValuesInCollection',
headers: {'content-type': 'application/json'},
data: {ignoreCase: '', input: [], match: '', replacement: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ReplaceValuesInCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignoreCase":"","input":[],"match":"","replacement":""}'
};
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 = @{ @"ignoreCase": @"",
@"input": @[ ],
@"match": @"",
@"replacement": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ReplaceValuesInCollection"]
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}}/ReplaceValuesInCollection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ReplaceValuesInCollection",
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([
'ignoreCase' => '',
'input' => [
],
'match' => '',
'replacement' => ''
]),
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}}/ReplaceValuesInCollection', [
'body' => '{
"ignoreCase": "",
"input": [],
"match": "",
"replacement": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ReplaceValuesInCollection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ignoreCase' => '',
'input' => [
],
'match' => '',
'replacement' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ignoreCase' => '',
'input' => [
],
'match' => '',
'replacement' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ReplaceValuesInCollection');
$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}}/ReplaceValuesInCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignoreCase": "",
"input": [],
"match": "",
"replacement": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ReplaceValuesInCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignoreCase": "",
"input": [],
"match": "",
"replacement": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ReplaceValuesInCollection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ReplaceValuesInCollection"
payload = {
"ignoreCase": "",
"input": [],
"match": "",
"replacement": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ReplaceValuesInCollection"
payload <- "{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\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}}/ReplaceValuesInCollection")
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 \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\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/ReplaceValuesInCollection') do |req|
req.body = "{\n \"ignoreCase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"replacement\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ReplaceValuesInCollection";
let payload = json!({
"ignoreCase": "",
"input": (),
"match": "",
"replacement": ""
});
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}}/ReplaceValuesInCollection \
--header 'content-type: application/json' \
--data '{
"ignoreCase": "",
"input": [],
"match": "",
"replacement": ""
}'
echo '{
"ignoreCase": "",
"input": [],
"match": "",
"replacement": ""
}' | \
http POST {{baseUrl}}/ReplaceValuesInCollection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ignoreCase": "",\n "input": [],\n "match": "",\n "replacement": ""\n}' \
--output-document \
- {{baseUrl}}/ReplaceValuesInCollection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ignoreCase": "",
"input": [],
"match": "",
"replacement": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ReplaceValuesInCollection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": [
"a",
"b",
"c"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Sort collection
{{baseUrl}}/SortCollection
BODY json
{
"input": [],
"order": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/SortCollection");
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 \"input\": [],\n \"order\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/SortCollection" {:content-type :json
:form-params {:input []
:order ""}})
require "http/client"
url = "{{baseUrl}}/SortCollection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": [],\n \"order\": \"\"\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}}/SortCollection"),
Content = new StringContent("{\n \"input\": [],\n \"order\": \"\"\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}}/SortCollection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": [],\n \"order\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/SortCollection"
payload := strings.NewReader("{\n \"input\": [],\n \"order\": \"\"\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/SortCollection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 32
{
"input": [],
"order": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/SortCollection")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": [],\n \"order\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/SortCollection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": [],\n \"order\": \"\"\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 \"input\": [],\n \"order\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/SortCollection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/SortCollection")
.header("content-type", "application/json")
.body("{\n \"input\": [],\n \"order\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: [],
order: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/SortCollection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/SortCollection',
headers: {'content-type': 'application/json'},
data: {input: [], order: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/SortCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"order":""}'
};
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}}/SortCollection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": [],\n "order": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": [],\n \"order\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/SortCollection")
.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/SortCollection',
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({input: [], order: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/SortCollection',
headers: {'content-type': 'application/json'},
body: {input: [], order: ''},
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}}/SortCollection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: [],
order: ''
});
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}}/SortCollection',
headers: {'content-type': 'application/json'},
data: {input: [], order: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/SortCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"order":""}'
};
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 = @{ @"input": @[ ],
@"order": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/SortCollection"]
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}}/SortCollection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": [],\n \"order\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/SortCollection",
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([
'input' => [
],
'order' => ''
]),
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}}/SortCollection', [
'body' => '{
"input": [],
"order": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/SortCollection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => [
],
'order' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => [
],
'order' => ''
]));
$request->setRequestUrl('{{baseUrl}}/SortCollection');
$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}}/SortCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"order": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/SortCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"order": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": [],\n \"order\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/SortCollection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/SortCollection"
payload = {
"input": [],
"order": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/SortCollection"
payload <- "{\n \"input\": [],\n \"order\": \"\"\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}}/SortCollection")
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 \"input\": [],\n \"order\": \"\"\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/SortCollection') do |req|
req.body = "{\n \"input\": [],\n \"order\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/SortCollection";
let payload = json!({
"input": (),
"order": ""
});
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}}/SortCollection \
--header 'content-type: application/json' \
--data '{
"input": [],
"order": ""
}'
echo '{
"input": [],
"order": ""
}' | \
http POST {{baseUrl}}/SortCollection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": [],\n "order": ""\n}' \
--output-document \
- {{baseUrl}}/SortCollection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": [],
"order": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/SortCollection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": [
"a",
"b",
"c"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Split collection
{{baseUrl}}/SplitCollection
BODY json
{
"index": "",
"input": [],
"match": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/SplitCollection");
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 \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/SplitCollection" {:content-type :json
:form-params {:index ""
:input []
:match ""}})
require "http/client"
url = "{{baseUrl}}/SplitCollection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\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}}/SplitCollection"),
Content = new StringContent("{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\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}}/SplitCollection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/SplitCollection"
payload := strings.NewReader("{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\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/SplitCollection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 47
{
"index": "",
"input": [],
"match": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/SplitCollection")
.setHeader("content-type", "application/json")
.setBody("{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/SplitCollection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\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 \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/SplitCollection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/SplitCollection")
.header("content-type", "application/json")
.body("{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\n}")
.asString();
const data = JSON.stringify({
index: '',
input: [],
match: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/SplitCollection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/SplitCollection',
headers: {'content-type': 'application/json'},
data: {index: '', input: [], match: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/SplitCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"index":"","input":[],"match":""}'
};
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}}/SplitCollection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "index": "",\n "input": [],\n "match": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/SplitCollection")
.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/SplitCollection',
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({index: '', input: [], match: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/SplitCollection',
headers: {'content-type': 'application/json'},
body: {index: '', input: [], match: ''},
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}}/SplitCollection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
index: '',
input: [],
match: ''
});
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}}/SplitCollection',
headers: {'content-type': 'application/json'},
data: {index: '', input: [], match: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/SplitCollection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"index":"","input":[],"match":""}'
};
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 = @{ @"index": @"",
@"input": @[ ],
@"match": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/SplitCollection"]
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}}/SplitCollection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/SplitCollection",
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([
'index' => '',
'input' => [
],
'match' => ''
]),
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}}/SplitCollection', [
'body' => '{
"index": "",
"input": [],
"match": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/SplitCollection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'index' => '',
'input' => [
],
'match' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'index' => '',
'input' => [
],
'match' => ''
]));
$request->setRequestUrl('{{baseUrl}}/SplitCollection');
$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}}/SplitCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"index": "",
"input": [],
"match": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/SplitCollection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"index": "",
"input": [],
"match": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/SplitCollection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/SplitCollection"
payload = {
"index": "",
"input": [],
"match": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/SplitCollection"
payload <- "{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\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}}/SplitCollection")
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 \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\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/SplitCollection') do |req|
req.body = "{\n \"index\": \"\",\n \"input\": [],\n \"match\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/SplitCollection";
let payload = json!({
"index": "",
"input": (),
"match": ""
});
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}}/SplitCollection \
--header 'content-type: application/json' \
--data '{
"index": "",
"input": [],
"match": ""
}'
echo '{
"index": "",
"input": [],
"match": ""
}' | \
http POST {{baseUrl}}/SplitCollection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "index": "",\n "input": [],\n "match": ""\n}' \
--output-document \
- {{baseUrl}}/SplitCollection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"index": "",
"input": [],
"match": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/SplitCollection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result1": [
"a",
"b",
"c"
],
"result2": [
"d",
"e",
"f"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Collections - Starts with string
{{baseUrl}}/CollectionStartsWithString
BODY json
{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CollectionStartsWithString");
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 \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CollectionStartsWithString" {:content-type :json
:form-params {:ignorecase ""
:input []
:match ""
:trim ""}})
require "http/client"
url = "{{baseUrl}}/CollectionStartsWithString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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}}/CollectionStartsWithString"),
Content = new StringContent("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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}}/CollectionStartsWithString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CollectionStartsWithString"
payload := strings.NewReader("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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/CollectionStartsWithString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 66
{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CollectionStartsWithString")
.setHeader("content-type", "application/json")
.setBody("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CollectionStartsWithString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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 \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CollectionStartsWithString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CollectionStartsWithString")
.header("content-type", "application/json")
.body("{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}")
.asString();
const data = JSON.stringify({
ignorecase: '',
input: [],
match: '',
trim: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CollectionStartsWithString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionStartsWithString',
headers: {'content-type': 'application/json'},
data: {ignorecase: '', input: [], match: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CollectionStartsWithString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignorecase":"","input":[],"match":"","trim":""}'
};
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}}/CollectionStartsWithString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ignorecase": "",\n "input": [],\n "match": "",\n "trim": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CollectionStartsWithString")
.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/CollectionStartsWithString',
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({ignorecase: '', input: [], match: '', trim: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CollectionStartsWithString',
headers: {'content-type': 'application/json'},
body: {ignorecase: '', input: [], match: '', trim: ''},
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}}/CollectionStartsWithString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ignorecase: '',
input: [],
match: '',
trim: ''
});
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}}/CollectionStartsWithString',
headers: {'content-type': 'application/json'},
data: {ignorecase: '', input: [], match: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CollectionStartsWithString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignorecase":"","input":[],"match":"","trim":""}'
};
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 = @{ @"ignorecase": @"",
@"input": @[ ],
@"match": @"",
@"trim": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CollectionStartsWithString"]
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}}/CollectionStartsWithString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CollectionStartsWithString",
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([
'ignorecase' => '',
'input' => [
],
'match' => '',
'trim' => ''
]),
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}}/CollectionStartsWithString', [
'body' => '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CollectionStartsWithString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ignorecase' => '',
'input' => [
],
'match' => '',
'trim' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ignorecase' => '',
'input' => [
],
'match' => '',
'trim' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CollectionStartsWithString');
$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}}/CollectionStartsWithString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CollectionStartsWithString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CollectionStartsWithString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CollectionStartsWithString"
payload = {
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CollectionStartsWithString"
payload <- "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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}}/CollectionStartsWithString")
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 \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\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/CollectionStartsWithString') do |req|
req.body = "{\n \"ignorecase\": \"\",\n \"input\": [],\n \"match\": \"\",\n \"trim\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CollectionStartsWithString";
let payload = json!({
"ignorecase": "",
"input": (),
"match": "",
"trim": ""
});
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}}/CollectionStartsWithString \
--header 'content-type: application/json' \
--data '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}'
echo '{
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
}' | \
http POST {{baseUrl}}/CollectionStartsWithString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ignorecase": "",\n "input": [],\n "match": "",\n "trim": ""\n}' \
--output-document \
- {{baseUrl}}/CollectionStartsWithString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ignorecase": "",
"input": [],
"match": "",
"trim": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CollectionStartsWithString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"item": "string",
"items": [
"string"
],
"status": false
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Data - CSV to JSON
{{baseUrl}}/CSVtoJSON
BODY json
{
"header": false,
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CSVtoJSON");
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 \"header\": false,\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CSVtoJSON" {:content-type :json
:form-params {:header false
:input ""}})
require "http/client"
url = "{{baseUrl}}/CSVtoJSON"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"header\": false,\n \"input\": \"\"\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}}/CSVtoJSON"),
Content = new StringContent("{\n \"header\": false,\n \"input\": \"\"\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}}/CSVtoJSON");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"header\": false,\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CSVtoJSON"
payload := strings.NewReader("{\n \"header\": false,\n \"input\": \"\"\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/CSVtoJSON HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 36
{
"header": false,
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CSVtoJSON")
.setHeader("content-type", "application/json")
.setBody("{\n \"header\": false,\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CSVtoJSON"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"header\": false,\n \"input\": \"\"\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 \"header\": false,\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CSVtoJSON")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CSVtoJSON")
.header("content-type", "application/json")
.body("{\n \"header\": false,\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
header: false,
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CSVtoJSON');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CSVtoJSON',
headers: {'content-type': 'application/json'},
data: {header: false, input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CSVtoJSON';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"header":false,"input":""}'
};
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}}/CSVtoJSON',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "header": false,\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"header\": false,\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CSVtoJSON")
.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/CSVtoJSON',
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({header: false, input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CSVtoJSON',
headers: {'content-type': 'application/json'},
body: {header: false, input: ''},
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}}/CSVtoJSON');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
header: false,
input: ''
});
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}}/CSVtoJSON',
headers: {'content-type': 'application/json'},
data: {header: false, input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CSVtoJSON';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"header":false,"input":""}'
};
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 = @{ @"header": @NO,
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CSVtoJSON"]
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}}/CSVtoJSON" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"header\": false,\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CSVtoJSON",
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([
'header' => null,
'input' => ''
]),
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}}/CSVtoJSON', [
'body' => '{
"header": false,
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CSVtoJSON');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'header' => null,
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'header' => null,
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CSVtoJSON');
$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}}/CSVtoJSON' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"header": false,
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CSVtoJSON' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"header": false,
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"header\": false,\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CSVtoJSON", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CSVtoJSON"
payload = {
"header": False,
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CSVtoJSON"
payload <- "{\n \"header\": false,\n \"input\": \"\"\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}}/CSVtoJSON")
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 \"header\": false,\n \"input\": \"\"\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/CSVtoJSON') do |req|
req.body = "{\n \"header\": false,\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CSVtoJSON";
let payload = json!({
"header": false,
"input": ""
});
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}}/CSVtoJSON \
--header 'content-type: application/json' \
--data '{
"header": false,
"input": ""
}'
echo '{
"header": false,
"input": ""
}' | \
http POST {{baseUrl}}/CSVtoJSON \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "header": false,\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/CSVtoJSON
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"header": false,
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CSVtoJSON")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Data - JSON to CSV
{{baseUrl}}/JSONtoCSV
BODY json
{
"header": false,
"input": "",
"omit": "",
"order": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/JSONtoCSV");
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 \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/JSONtoCSV" {:content-type :json
:form-params {:header false
:input ""
:omit ""
:order ""}})
require "http/client"
url = "{{baseUrl}}/JSONtoCSV"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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}}/JSONtoCSV"),
Content = new StringContent("{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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}}/JSONtoCSV");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/JSONtoCSV"
payload := strings.NewReader("{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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/JSONtoCSV HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"header": false,
"input": "",
"omit": "",
"order": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/JSONtoCSV")
.setHeader("content-type", "application/json")
.setBody("{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/JSONtoCSV"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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 \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/JSONtoCSV")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/JSONtoCSV")
.header("content-type", "application/json")
.body("{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}")
.asString();
const data = JSON.stringify({
header: false,
input: '',
omit: '',
order: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/JSONtoCSV');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/JSONtoCSV',
headers: {'content-type': 'application/json'},
data: {header: false, input: '', omit: '', order: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/JSONtoCSV';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"header":false,"input":"","omit":"","order":""}'
};
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}}/JSONtoCSV',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "header": false,\n "input": "",\n "omit": "",\n "order": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/JSONtoCSV")
.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/JSONtoCSV',
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({header: false, input: '', omit: '', order: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/JSONtoCSV',
headers: {'content-type': 'application/json'},
body: {header: false, input: '', omit: '', order: ''},
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}}/JSONtoCSV');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
header: false,
input: '',
omit: '',
order: ''
});
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}}/JSONtoCSV',
headers: {'content-type': 'application/json'},
data: {header: false, input: '', omit: '', order: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/JSONtoCSV';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"header":false,"input":"","omit":"","order":""}'
};
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 = @{ @"header": @NO,
@"input": @"",
@"omit": @"",
@"order": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/JSONtoCSV"]
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}}/JSONtoCSV" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/JSONtoCSV",
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([
'header' => null,
'input' => '',
'omit' => '',
'order' => ''
]),
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}}/JSONtoCSV', [
'body' => '{
"header": false,
"input": "",
"omit": "",
"order": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/JSONtoCSV');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'header' => null,
'input' => '',
'omit' => '',
'order' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'header' => null,
'input' => '',
'omit' => '',
'order' => ''
]));
$request->setRequestUrl('{{baseUrl}}/JSONtoCSV');
$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}}/JSONtoCSV' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"header": false,
"input": "",
"omit": "",
"order": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/JSONtoCSV' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"header": false,
"input": "",
"omit": "",
"order": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/JSONtoCSV", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/JSONtoCSV"
payload = {
"header": False,
"input": "",
"omit": "",
"order": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/JSONtoCSV"
payload <- "{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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}}/JSONtoCSV")
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 \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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/JSONtoCSV') do |req|
req.body = "{\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/JSONtoCSV";
let payload = json!({
"header": false,
"input": "",
"omit": "",
"order": ""
});
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}}/JSONtoCSV \
--header 'content-type: application/json' \
--data '{
"header": false,
"input": "",
"omit": "",
"order": ""
}'
echo '{
"header": false,
"input": "",
"omit": "",
"order": ""
}' | \
http POST {{baseUrl}}/JSONtoCSV \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "header": false,\n "input": "",\n "omit": "",\n "order": ""\n}' \
--output-document \
- {{baseUrl}}/JSONtoCSV
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"header": false,
"input": "",
"omit": "",
"order": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/JSONtoCSV")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Data - JSON to HTML Table
{{baseUrl}}/JSONtoHTML
BODY json
{
"alternate": "",
"attributes": "",
"header": false,
"input": "",
"omit": "",
"order": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/JSONtoHTML");
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 \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/JSONtoHTML" {:content-type :json
:form-params {:alternate ""
:attributes ""
:header false
:input ""
:omit ""
:order ""}})
require "http/client"
url = "{{baseUrl}}/JSONtoHTML"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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}}/JSONtoHTML"),
Content = new StringContent("{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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}}/JSONtoHTML");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/JSONtoHTML"
payload := strings.NewReader("{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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/JSONtoHTML HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 104
{
"alternate": "",
"attributes": "",
"header": false,
"input": "",
"omit": "",
"order": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/JSONtoHTML")
.setHeader("content-type", "application/json")
.setBody("{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/JSONtoHTML"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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 \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/JSONtoHTML")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/JSONtoHTML")
.header("content-type", "application/json")
.body("{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}")
.asString();
const data = JSON.stringify({
alternate: '',
attributes: '',
header: false,
input: '',
omit: '',
order: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/JSONtoHTML');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/JSONtoHTML',
headers: {'content-type': 'application/json'},
data: {alternate: '', attributes: '', header: false, input: '', omit: '', order: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/JSONtoHTML';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"alternate":"","attributes":"","header":false,"input":"","omit":"","order":""}'
};
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}}/JSONtoHTML',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "alternate": "",\n "attributes": "",\n "header": false,\n "input": "",\n "omit": "",\n "order": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/JSONtoHTML")
.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/JSONtoHTML',
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({alternate: '', attributes: '', header: false, input: '', omit: '', order: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/JSONtoHTML',
headers: {'content-type': 'application/json'},
body: {alternate: '', attributes: '', header: false, input: '', omit: '', order: ''},
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}}/JSONtoHTML');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
alternate: '',
attributes: '',
header: false,
input: '',
omit: '',
order: ''
});
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}}/JSONtoHTML',
headers: {'content-type': 'application/json'},
data: {alternate: '', attributes: '', header: false, input: '', omit: '', order: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/JSONtoHTML';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"alternate":"","attributes":"","header":false,"input":"","omit":"","order":""}'
};
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 = @{ @"alternate": @"",
@"attributes": @"",
@"header": @NO,
@"input": @"",
@"omit": @"",
@"order": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/JSONtoHTML"]
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}}/JSONtoHTML" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/JSONtoHTML",
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([
'alternate' => '',
'attributes' => '',
'header' => null,
'input' => '',
'omit' => '',
'order' => ''
]),
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}}/JSONtoHTML', [
'body' => '{
"alternate": "",
"attributes": "",
"header": false,
"input": "",
"omit": "",
"order": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/JSONtoHTML');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'alternate' => '',
'attributes' => '',
'header' => null,
'input' => '',
'omit' => '',
'order' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'alternate' => '',
'attributes' => '',
'header' => null,
'input' => '',
'omit' => '',
'order' => ''
]));
$request->setRequestUrl('{{baseUrl}}/JSONtoHTML');
$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}}/JSONtoHTML' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"alternate": "",
"attributes": "",
"header": false,
"input": "",
"omit": "",
"order": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/JSONtoHTML' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"alternate": "",
"attributes": "",
"header": false,
"input": "",
"omit": "",
"order": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/JSONtoHTML", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/JSONtoHTML"
payload = {
"alternate": "",
"attributes": "",
"header": False,
"input": "",
"omit": "",
"order": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/JSONtoHTML"
payload <- "{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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}}/JSONtoHTML")
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 \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\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/JSONtoHTML') do |req|
req.body = "{\n \"alternate\": \"\",\n \"attributes\": \"\",\n \"header\": false,\n \"input\": \"\",\n \"omit\": \"\",\n \"order\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/JSONtoHTML";
let payload = json!({
"alternate": "",
"attributes": "",
"header": false,
"input": "",
"omit": "",
"order": ""
});
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}}/JSONtoHTML \
--header 'content-type: application/json' \
--data '{
"alternate": "",
"attributes": "",
"header": false,
"input": "",
"omit": "",
"order": ""
}'
echo '{
"alternate": "",
"attributes": "",
"header": false,
"input": "",
"omit": "",
"order": ""
}' | \
http POST {{baseUrl}}/JSONtoHTML \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "alternate": "",\n "attributes": "",\n "header": false,\n "input": "",\n "omit": "",\n "order": ""\n}' \
--output-document \
- {{baseUrl}}/JSONtoHTML
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"alternate": "",
"attributes": "",
"header": false,
"input": "",
"omit": "",
"order": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/JSONtoHTML")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Data - JSON to XML
{{baseUrl}}/JSONtoXML
BODY json
{
"input": "",
"root": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/JSONtoXML");
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 \"input\": \"\",\n \"root\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/JSONtoXML" {:content-type :json
:form-params {:input ""
:root ""}})
require "http/client"
url = "{{baseUrl}}/JSONtoXML"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"root\": \"\"\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}}/JSONtoXML"),
Content = new StringContent("{\n \"input\": \"\",\n \"root\": \"\"\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}}/JSONtoXML");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"root\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/JSONtoXML"
payload := strings.NewReader("{\n \"input\": \"\",\n \"root\": \"\"\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/JSONtoXML HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 31
{
"input": "",
"root": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/JSONtoXML")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"root\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/JSONtoXML"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"root\": \"\"\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 \"input\": \"\",\n \"root\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/JSONtoXML")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/JSONtoXML")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"root\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
root: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/JSONtoXML');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/JSONtoXML',
headers: {'content-type': 'application/json'},
data: {input: '', root: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/JSONtoXML';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","root":""}'
};
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}}/JSONtoXML',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "root": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"root\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/JSONtoXML")
.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/JSONtoXML',
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({input: '', root: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/JSONtoXML',
headers: {'content-type': 'application/json'},
body: {input: '', root: ''},
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}}/JSONtoXML');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
root: ''
});
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}}/JSONtoXML',
headers: {'content-type': 'application/json'},
data: {input: '', root: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/JSONtoXML';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","root":""}'
};
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 = @{ @"input": @"",
@"root": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/JSONtoXML"]
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}}/JSONtoXML" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"root\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/JSONtoXML",
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([
'input' => '',
'root' => ''
]),
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}}/JSONtoXML', [
'body' => '{
"input": "",
"root": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/JSONtoXML');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'root' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'root' => ''
]));
$request->setRequestUrl('{{baseUrl}}/JSONtoXML');
$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}}/JSONtoXML' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"root": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/JSONtoXML' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"root": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"root\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/JSONtoXML", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/JSONtoXML"
payload = {
"input": "",
"root": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/JSONtoXML"
payload <- "{\n \"input\": \"\",\n \"root\": \"\"\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}}/JSONtoXML")
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 \"input\": \"\",\n \"root\": \"\"\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/JSONtoXML') do |req|
req.body = "{\n \"input\": \"\",\n \"root\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/JSONtoXML";
let payload = json!({
"input": "",
"root": ""
});
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}}/JSONtoXML \
--header 'content-type: application/json' \
--data '{
"input": "",
"root": ""
}'
echo '{
"input": "",
"root": ""
}' | \
http POST {{baseUrl}}/JSONtoXML \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "root": ""\n}' \
--output-document \
- {{baseUrl}}/JSONtoXML
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"root": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/JSONtoXML")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Data - Query JSON
{{baseUrl}}/QueryJSON
BODY json
{
"input": "",
"query": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/QueryJSON");
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 \"input\": \"\",\n \"query\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/QueryJSON" {:content-type :json
:form-params {:input ""
:query ""}})
require "http/client"
url = "{{baseUrl}}/QueryJSON"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"query\": \"\"\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}}/QueryJSON"),
Content = new StringContent("{\n \"input\": \"\",\n \"query\": \"\"\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}}/QueryJSON");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"query\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/QueryJSON"
payload := strings.NewReader("{\n \"input\": \"\",\n \"query\": \"\"\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/QueryJSON HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 32
{
"input": "",
"query": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/QueryJSON")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"query\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/QueryJSON"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"query\": \"\"\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 \"input\": \"\",\n \"query\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/QueryJSON")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/QueryJSON")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"query\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
query: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/QueryJSON');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/QueryJSON',
headers: {'content-type': 'application/json'},
data: {input: '', query: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/QueryJSON';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","query":""}'
};
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}}/QueryJSON',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "query": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"query\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/QueryJSON")
.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/QueryJSON',
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({input: '', query: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/QueryJSON',
headers: {'content-type': 'application/json'},
body: {input: '', query: ''},
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}}/QueryJSON');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
query: ''
});
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}}/QueryJSON',
headers: {'content-type': 'application/json'},
data: {input: '', query: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/QueryJSON';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","query":""}'
};
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 = @{ @"input": @"",
@"query": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/QueryJSON"]
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}}/QueryJSON" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"query\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/QueryJSON",
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([
'input' => '',
'query' => ''
]),
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}}/QueryJSON', [
'body' => '{
"input": "",
"query": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/QueryJSON');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'query' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'query' => ''
]));
$request->setRequestUrl('{{baseUrl}}/QueryJSON');
$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}}/QueryJSON' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"query": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/QueryJSON' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"query": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"query\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/QueryJSON", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/QueryJSON"
payload = {
"input": "",
"query": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/QueryJSON"
payload <- "{\n \"input\": \"\",\n \"query\": \"\"\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}}/QueryJSON")
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 \"input\": \"\",\n \"query\": \"\"\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/QueryJSON') do |req|
req.body = "{\n \"input\": \"\",\n \"query\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/QueryJSON";
let payload = json!({
"input": "",
"query": ""
});
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}}/QueryJSON \
--header 'content-type: application/json' \
--data '{
"input": "",
"query": ""
}'
echo '{
"input": "",
"query": ""
}' | \
http POST {{baseUrl}}/QueryJSON \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "query": ""\n}' \
--output-document \
- {{baseUrl}}/QueryJSON
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"query": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/QueryJSON")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Data - Query XML
{{baseUrl}}/QueryXML
BODY json
{
"input": "",
"query": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/QueryXML");
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 \"input\": \"\",\n \"query\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/QueryXML" {:content-type :json
:form-params {:input ""
:query ""}})
require "http/client"
url = "{{baseUrl}}/QueryXML"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"query\": \"\"\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}}/QueryXML"),
Content = new StringContent("{\n \"input\": \"\",\n \"query\": \"\"\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}}/QueryXML");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"query\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/QueryXML"
payload := strings.NewReader("{\n \"input\": \"\",\n \"query\": \"\"\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/QueryXML HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 32
{
"input": "",
"query": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/QueryXML")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"query\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/QueryXML"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"query\": \"\"\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 \"input\": \"\",\n \"query\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/QueryXML")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/QueryXML")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"query\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
query: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/QueryXML');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/QueryXML',
headers: {'content-type': 'application/json'},
data: {input: '', query: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/QueryXML';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","query":""}'
};
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}}/QueryXML',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "query": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"query\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/QueryXML")
.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/QueryXML',
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({input: '', query: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/QueryXML',
headers: {'content-type': 'application/json'},
body: {input: '', query: ''},
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}}/QueryXML');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
query: ''
});
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}}/QueryXML',
headers: {'content-type': 'application/json'},
data: {input: '', query: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/QueryXML';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","query":""}'
};
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 = @{ @"input": @"",
@"query": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/QueryXML"]
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}}/QueryXML" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"query\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/QueryXML",
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([
'input' => '',
'query' => ''
]),
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}}/QueryXML', [
'body' => '{
"input": "",
"query": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/QueryXML');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'query' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'query' => ''
]));
$request->setRequestUrl('{{baseUrl}}/QueryXML');
$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}}/QueryXML' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"query": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/QueryXML' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"query": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"query\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/QueryXML", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/QueryXML"
payload = {
"input": "",
"query": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/QueryXML"
payload <- "{\n \"input\": \"\",\n \"query\": \"\"\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}}/QueryXML")
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 \"input\": \"\",\n \"query\": \"\"\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/QueryXML') do |req|
req.body = "{\n \"input\": \"\",\n \"query\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/QueryXML";
let payload = json!({
"input": "",
"query": ""
});
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}}/QueryXML \
--header 'content-type: application/json' \
--data '{
"input": "",
"query": ""
}'
echo '{
"input": "",
"query": ""
}' | \
http POST {{baseUrl}}/QueryXML \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "query": ""\n}' \
--output-document \
- {{baseUrl}}/QueryXML
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"query": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/QueryXML")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Data - XML to JSON
{{baseUrl}}/XMLtoJSON
BODY json
{
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/XMLtoJSON");
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 \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/XMLtoJSON" {:content-type :json
:form-params {:input ""}})
require "http/client"
url = "{{baseUrl}}/XMLtoJSON"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\"\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}}/XMLtoJSON"),
Content = new StringContent("{\n \"input\": \"\"\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}}/XMLtoJSON");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/XMLtoJSON"
payload := strings.NewReader("{\n \"input\": \"\"\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/XMLtoJSON HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 17
{
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/XMLtoJSON")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/XMLtoJSON"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\"\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 \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/XMLtoJSON")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/XMLtoJSON")
.header("content-type", "application/json")
.body("{\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/XMLtoJSON');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/XMLtoJSON',
headers: {'content-type': 'application/json'},
data: {input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/XMLtoJSON';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":""}'
};
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}}/XMLtoJSON',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/XMLtoJSON")
.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/XMLtoJSON',
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({input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/XMLtoJSON',
headers: {'content-type': 'application/json'},
body: {input: ''},
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}}/XMLtoJSON');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: ''
});
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}}/XMLtoJSON',
headers: {'content-type': 'application/json'},
data: {input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/XMLtoJSON';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":""}'
};
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 = @{ @"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/XMLtoJSON"]
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}}/XMLtoJSON" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/XMLtoJSON",
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([
'input' => ''
]),
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}}/XMLtoJSON', [
'body' => '{
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/XMLtoJSON');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/XMLtoJSON');
$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}}/XMLtoJSON' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/XMLtoJSON' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/XMLtoJSON", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/XMLtoJSON"
payload = { "input": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/XMLtoJSON"
payload <- "{\n \"input\": \"\"\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}}/XMLtoJSON")
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 \"input\": \"\"\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/XMLtoJSON') do |req|
req.body = "{\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/XMLtoJSON";
let payload = json!({"input": ""});
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}}/XMLtoJSON \
--header 'content-type: application/json' \
--data '{
"input": ""
}'
echo '{
"input": ""
}' | \
http POST {{baseUrl}}/XMLtoJSON \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/XMLtoJSON
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["input": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/XMLtoJSON")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
DateTime - DateTime difference
{{baseUrl}}/DateTimeDifference
BODY json
{
"dateTime1": "",
"dateTime2": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DateTimeDifference");
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 \"dateTime1\": \"\",\n \"dateTime2\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DateTimeDifference" {:content-type :json
:form-params {:dateTime1 ""
:dateTime2 ""}})
require "http/client"
url = "{{baseUrl}}/DateTimeDifference"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\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}}/DateTimeDifference"),
Content = new StringContent("{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\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}}/DateTimeDifference");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DateTimeDifference"
payload := strings.NewReader("{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\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/DateTimeDifference HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"dateTime1": "",
"dateTime2": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DateTimeDifference")
.setHeader("content-type", "application/json")
.setBody("{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DateTimeDifference"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\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 \"dateTime1\": \"\",\n \"dateTime2\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DateTimeDifference")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DateTimeDifference")
.header("content-type", "application/json")
.body("{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\n}")
.asString();
const data = JSON.stringify({
dateTime1: '',
dateTime2: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DateTimeDifference');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DateTimeDifference',
headers: {'content-type': 'application/json'},
data: {dateTime1: '', dateTime2: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DateTimeDifference';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dateTime1":"","dateTime2":""}'
};
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}}/DateTimeDifference',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dateTime1": "",\n "dateTime2": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DateTimeDifference")
.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/DateTimeDifference',
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({dateTime1: '', dateTime2: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DateTimeDifference',
headers: {'content-type': 'application/json'},
body: {dateTime1: '', dateTime2: ''},
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}}/DateTimeDifference');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dateTime1: '',
dateTime2: ''
});
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}}/DateTimeDifference',
headers: {'content-type': 'application/json'},
data: {dateTime1: '', dateTime2: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DateTimeDifference';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dateTime1":"","dateTime2":""}'
};
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 = @{ @"dateTime1": @"",
@"dateTime2": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DateTimeDifference"]
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}}/DateTimeDifference" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DateTimeDifference",
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([
'dateTime1' => '',
'dateTime2' => ''
]),
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}}/DateTimeDifference', [
'body' => '{
"dateTime1": "",
"dateTime2": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DateTimeDifference');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dateTime1' => '',
'dateTime2' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dateTime1' => '',
'dateTime2' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DateTimeDifference');
$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}}/DateTimeDifference' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dateTime1": "",
"dateTime2": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DateTimeDifference' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dateTime1": "",
"dateTime2": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DateTimeDifference", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DateTimeDifference"
payload = {
"dateTime1": "",
"dateTime2": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DateTimeDifference"
payload <- "{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\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}}/DateTimeDifference")
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 \"dateTime1\": \"\",\n \"dateTime2\": \"\"\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/DateTimeDifference') do |req|
req.body = "{\n \"dateTime1\": \"\",\n \"dateTime2\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DateTimeDifference";
let payload = json!({
"dateTime1": "",
"dateTime2": ""
});
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}}/DateTimeDifference \
--header 'content-type: application/json' \
--data '{
"dateTime1": "",
"dateTime2": ""
}'
echo '{
"dateTime1": "",
"dateTime2": ""
}' | \
http POST {{baseUrl}}/DateTimeDifference \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dateTime1": "",\n "dateTime2": ""\n}' \
--output-document \
- {{baseUrl}}/DateTimeDifference
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"dateTime1": "",
"dateTime2": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DateTimeDifference")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"days": 14,
"hours": 1,
"milliseconds": 0,
"minutes": 50,
"months": 2,
"seconds": 30,
"ticks": 378498300000000,
"totalDays": 438.08,
"totalHours": 10513.84,
"totalMilliseconds": 37849830000,
"totalMinutes": 630830.5,
"totalMonths": 14.39,
"totalSeconds": 37849830,
"totalYears": 1.2,
"years": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
DateTime - Format date and time
{{baseUrl}}/FormatDateTime
BODY json
{
"culture": "",
"format": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/FormatDateTime");
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 \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/FormatDateTime" {:content-type :json
:form-params {:culture ""
:format ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/FormatDateTime"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\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}}/FormatDateTime"),
Content = new StringContent("{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\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}}/FormatDateTime");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/FormatDateTime"
payload := strings.NewReader("{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\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/FormatDateTime HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"culture": "",
"format": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/FormatDateTime")
.setHeader("content-type", "application/json")
.setBody("{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/FormatDateTime"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\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 \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/FormatDateTime")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/FormatDateTime")
.header("content-type", "application/json")
.body("{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
culture: '',
format: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/FormatDateTime');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/FormatDateTime',
headers: {'content-type': 'application/json'},
data: {culture: '', format: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/FormatDateTime';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"culture":"","format":"","input":""}'
};
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}}/FormatDateTime',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "culture": "",\n "format": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/FormatDateTime")
.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/FormatDateTime',
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({culture: '', format: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/FormatDateTime',
headers: {'content-type': 'application/json'},
body: {culture: '', format: '', input: ''},
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}}/FormatDateTime');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
culture: '',
format: '',
input: ''
});
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}}/FormatDateTime',
headers: {'content-type': 'application/json'},
data: {culture: '', format: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/FormatDateTime';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"culture":"","format":"","input":""}'
};
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 = @{ @"culture": @"",
@"format": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/FormatDateTime"]
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}}/FormatDateTime" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/FormatDateTime",
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([
'culture' => '',
'format' => '',
'input' => ''
]),
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}}/FormatDateTime', [
'body' => '{
"culture": "",
"format": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/FormatDateTime');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'culture' => '',
'format' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'culture' => '',
'format' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/FormatDateTime');
$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}}/FormatDateTime' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"culture": "",
"format": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/FormatDateTime' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"culture": "",
"format": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/FormatDateTime", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/FormatDateTime"
payload = {
"culture": "",
"format": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/FormatDateTime"
payload <- "{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\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}}/FormatDateTime")
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 \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\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/FormatDateTime') do |req|
req.body = "{\n \"culture\": \"\",\n \"format\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/FormatDateTime";
let payload = json!({
"culture": "",
"format": "",
"input": ""
});
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}}/FormatDateTime \
--header 'content-type: application/json' \
--data '{
"culture": "",
"format": "",
"input": ""
}'
echo '{
"culture": "",
"format": "",
"input": ""
}' | \
http POST {{baseUrl}}/FormatDateTime \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "culture": "",\n "format": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/FormatDateTime
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"culture": "",
"format": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/FormatDateTime")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
DateTime - Get date and time information
{{baseUrl}}/DateTimeInfo
BODY json
{
"culture": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DateTimeInfo");
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 \"culture\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DateTimeInfo" {:content-type :json
:form-params {:culture ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/DateTimeInfo"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"culture\": \"\",\n \"input\": \"\"\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}}/DateTimeInfo"),
Content = new StringContent("{\n \"culture\": \"\",\n \"input\": \"\"\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}}/DateTimeInfo");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"culture\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DateTimeInfo"
payload := strings.NewReader("{\n \"culture\": \"\",\n \"input\": \"\"\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/DateTimeInfo HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 34
{
"culture": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DateTimeInfo")
.setHeader("content-type", "application/json")
.setBody("{\n \"culture\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DateTimeInfo"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"culture\": \"\",\n \"input\": \"\"\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 \"culture\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DateTimeInfo")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DateTimeInfo")
.header("content-type", "application/json")
.body("{\n \"culture\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
culture: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DateTimeInfo');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DateTimeInfo',
headers: {'content-type': 'application/json'},
data: {culture: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DateTimeInfo';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"culture":"","input":""}'
};
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}}/DateTimeInfo',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "culture": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"culture\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DateTimeInfo")
.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/DateTimeInfo',
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({culture: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DateTimeInfo',
headers: {'content-type': 'application/json'},
body: {culture: '', input: ''},
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}}/DateTimeInfo');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
culture: '',
input: ''
});
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}}/DateTimeInfo',
headers: {'content-type': 'application/json'},
data: {culture: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DateTimeInfo';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"culture":"","input":""}'
};
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 = @{ @"culture": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DateTimeInfo"]
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}}/DateTimeInfo" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"culture\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DateTimeInfo",
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([
'culture' => '',
'input' => ''
]),
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}}/DateTimeInfo', [
'body' => '{
"culture": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DateTimeInfo');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'culture' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'culture' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DateTimeInfo');
$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}}/DateTimeInfo' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"culture": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DateTimeInfo' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"culture": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"culture\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DateTimeInfo", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DateTimeInfo"
payload = {
"culture": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DateTimeInfo"
payload <- "{\n \"culture\": \"\",\n \"input\": \"\"\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}}/DateTimeInfo")
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 \"culture\": \"\",\n \"input\": \"\"\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/DateTimeInfo') do |req|
req.body = "{\n \"culture\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DateTimeInfo";
let payload = json!({
"culture": "",
"input": ""
});
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}}/DateTimeInfo \
--header 'content-type: application/json' \
--data '{
"culture": "",
"input": ""
}'
echo '{
"culture": "",
"input": ""
}' | \
http POST {{baseUrl}}/DateTimeInfo \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "culture": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/DateTimeInfo
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"culture": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DateTimeInfo")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"DayOfWeek": 2,
"DayOfYear": 25,
"MinutesInDay": 359,
"SecondsInDay": 1234,
"Ticks": 1234567890,
"WeekOfYear": 10
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
DateTime - Get world time
{{baseUrl}}/WorldTime
BODY json
{
"format": "",
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/WorldTime");
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 \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/WorldTime" {:content-type :json
:form-params {:format ""
:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/WorldTime"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/WorldTime"),
Content = new StringContent("{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/WorldTime");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/WorldTime"
payload := strings.NewReader("{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/WorldTime HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"format": "",
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/WorldTime")
.setHeader("content-type", "application/json")
.setBody("{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/WorldTime"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/WorldTime")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/WorldTime")
.header("content-type", "application/json")
.body("{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
format: '',
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/WorldTime');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/WorldTime',
headers: {'content-type': 'application/json'},
data: {format: '', input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/WorldTime';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"format":"","input":"","source":"","target":""}'
};
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}}/WorldTime',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "format": "",\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/WorldTime")
.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/WorldTime',
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({format: '', input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/WorldTime',
headers: {'content-type': 'application/json'},
body: {format: '', input: '', source: '', target: ''},
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}}/WorldTime');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
format: '',
input: '',
source: '',
target: ''
});
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}}/WorldTime',
headers: {'content-type': 'application/json'},
data: {format: '', input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/WorldTime';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"format":"","input":"","source":"","target":""}'
};
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 = @{ @"format": @"",
@"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/WorldTime"]
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}}/WorldTime" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/WorldTime",
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([
'format' => '',
'input' => '',
'source' => '',
'target' => ''
]),
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}}/WorldTime', [
'body' => '{
"format": "",
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/WorldTime');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'format' => '',
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'format' => '',
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/WorldTime');
$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}}/WorldTime' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"format": "",
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/WorldTime' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"format": "",
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/WorldTime", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/WorldTime"
payload = {
"format": "",
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/WorldTime"
payload <- "{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/WorldTime")
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 \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/WorldTime') do |req|
req.body = "{\n \"format\": \"\",\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/WorldTime";
let payload = json!({
"format": "",
"input": "",
"source": "",
"target": ""
});
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}}/WorldTime \
--header 'content-type: application/json' \
--data '{
"format": "",
"input": "",
"source": "",
"target": ""
}'
echo '{
"format": "",
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/WorldTime \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "format": "",\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/WorldTime
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"format": "",
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/WorldTime")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Files - Convert Image
{{baseUrl}}/ConvertImage
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertImage");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertImage")
require "http/client"
url = "{{baseUrl}}/ConvertImage"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/ConvertImage"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/ConvertImage");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertImage"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ConvertImage HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertImage")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertImage"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertImage")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertImage")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertImage');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/ConvertImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertImage';
const options = {method: 'POST'};
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}}/ConvertImage',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/ConvertImage")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ConvertImage',
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: 'POST', url: '{{baseUrl}}/ConvertImage'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/ConvertImage');
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}}/ConvertImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertImage';
const options = {method: 'POST'};
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}}/ConvertImage"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/ConvertImage" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertImage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ConvertImage');
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertImage');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/ConvertImage');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ConvertImage' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertImage' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/ConvertImage", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertImage"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertImage"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ConvertImage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/ConvertImage') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertImage";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ConvertImage
http POST {{baseUrl}}/ConvertImage
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/ConvertImage
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertImage")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
image/bmp
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
image/gif
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
image/jpeg
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
image/png
RESPONSE BODY text
{
"result": "string"
}
POST
Files - Crop Image
{{baseUrl}}/CropImage
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CropImage");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CropImage")
require "http/client"
url = "{{baseUrl}}/CropImage"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/CropImage"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/CropImage");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CropImage"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/CropImage HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CropImage")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CropImage"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/CropImage")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CropImage")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CropImage');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/CropImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CropImage';
const options = {method: 'POST'};
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}}/CropImage',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/CropImage")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/CropImage',
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: 'POST', url: '{{baseUrl}}/CropImage'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/CropImage');
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}}/CropImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CropImage';
const options = {method: 'POST'};
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}}/CropImage"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/CropImage" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CropImage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/CropImage');
echo $response->getBody();
setUrl('{{baseUrl}}/CropImage');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/CropImage');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/CropImage' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CropImage' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/CropImage", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CropImage"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CropImage"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/CropImage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/CropImage') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CropImage";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/CropImage
http POST {{baseUrl}}/CropImage
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/CropImage
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CropImage")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
image/bmp
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
image/gif
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
image/jpeg
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
image/png
RESPONSE BODY text
{
"result": "string"
}
POST
Files - File to string
{{baseUrl}}/FileToString
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/FileToString");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/FileToString")
require "http/client"
url = "{{baseUrl}}/FileToString"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/FileToString"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/FileToString");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/FileToString"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/FileToString HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/FileToString")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/FileToString"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/FileToString")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/FileToString")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/FileToString');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/FileToString'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/FileToString';
const options = {method: 'POST'};
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}}/FileToString',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/FileToString")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/FileToString',
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: 'POST', url: '{{baseUrl}}/FileToString'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/FileToString');
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}}/FileToString'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/FileToString';
const options = {method: 'POST'};
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}}/FileToString"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/FileToString" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/FileToString",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/FileToString');
echo $response->getBody();
setUrl('{{baseUrl}}/FileToString');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/FileToString');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/FileToString' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/FileToString' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/FileToString", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/FileToString"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/FileToString"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/FileToString")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/FileToString') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/FileToString";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/FileToString
http POST {{baseUrl}}/FileToString
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/FileToString
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/FileToString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Files - Flip Image
{{baseUrl}}/FlipImage
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/FlipImage");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/FlipImage")
require "http/client"
url = "{{baseUrl}}/FlipImage"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/FlipImage"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/FlipImage");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/FlipImage"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/FlipImage HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/FlipImage")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/FlipImage"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/FlipImage")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/FlipImage")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/FlipImage');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/FlipImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/FlipImage';
const options = {method: 'POST'};
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}}/FlipImage',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/FlipImage")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/FlipImage',
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: 'POST', url: '{{baseUrl}}/FlipImage'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/FlipImage');
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}}/FlipImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/FlipImage';
const options = {method: 'POST'};
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}}/FlipImage"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/FlipImage" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/FlipImage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/FlipImage');
echo $response->getBody();
setUrl('{{baseUrl}}/FlipImage');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/FlipImage');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/FlipImage' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/FlipImage' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/FlipImage", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/FlipImage"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/FlipImage"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/FlipImage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/FlipImage') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/FlipImage";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/FlipImage
http POST {{baseUrl}}/FlipImage
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/FlipImage
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/FlipImage")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
*/*
RESPONSE BODY text
{
"result": "string"
}
POST
Files - Generate QR code
{{baseUrl}}/GenerateQRCode
BODY json
{
"input": "",
"payload": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/GenerateQRCode");
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 \"input\": \"\",\n \"payload\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/GenerateQRCode" {:content-type :json
:form-params {:input ""
:payload ""}})
require "http/client"
url = "{{baseUrl}}/GenerateQRCode"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"payload\": \"\"\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}}/GenerateQRCode"),
Content = new StringContent("{\n \"input\": \"\",\n \"payload\": \"\"\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}}/GenerateQRCode");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"payload\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/GenerateQRCode"
payload := strings.NewReader("{\n \"input\": \"\",\n \"payload\": \"\"\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/GenerateQRCode HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 34
{
"input": "",
"payload": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/GenerateQRCode")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"payload\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/GenerateQRCode"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"payload\": \"\"\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 \"input\": \"\",\n \"payload\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/GenerateQRCode")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/GenerateQRCode")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"payload\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
payload: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/GenerateQRCode');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/GenerateQRCode',
headers: {'content-type': 'application/json'},
data: {input: '', payload: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/GenerateQRCode';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","payload":""}'
};
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}}/GenerateQRCode',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "payload": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"payload\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/GenerateQRCode")
.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/GenerateQRCode',
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({input: '', payload: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/GenerateQRCode',
headers: {'content-type': 'application/json'},
body: {input: '', payload: ''},
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}}/GenerateQRCode');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
payload: ''
});
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}}/GenerateQRCode',
headers: {'content-type': 'application/json'},
data: {input: '', payload: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/GenerateQRCode';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","payload":""}'
};
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 = @{ @"input": @"",
@"payload": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/GenerateQRCode"]
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}}/GenerateQRCode" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"payload\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/GenerateQRCode",
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([
'input' => '',
'payload' => ''
]),
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}}/GenerateQRCode', [
'body' => '{
"input": "",
"payload": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/GenerateQRCode');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'payload' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'payload' => ''
]));
$request->setRequestUrl('{{baseUrl}}/GenerateQRCode');
$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}}/GenerateQRCode' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"payload": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/GenerateQRCode' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"payload": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"payload\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/GenerateQRCode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/GenerateQRCode"
payload = {
"input": "",
"payload": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/GenerateQRCode"
payload <- "{\n \"input\": \"\",\n \"payload\": \"\"\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}}/GenerateQRCode")
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 \"input\": \"\",\n \"payload\": \"\"\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/GenerateQRCode') do |req|
req.body = "{\n \"input\": \"\",\n \"payload\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/GenerateQRCode";
let payload = json!({
"input": "",
"payload": ""
});
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}}/GenerateQRCode \
--header 'content-type: application/json' \
--data '{
"input": "",
"payload": ""
}'
echo '{
"input": "",
"payload": ""
}' | \
http POST {{baseUrl}}/GenerateQRCode \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "payload": ""\n}' \
--output-document \
- {{baseUrl}}/GenerateQRCode
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"payload": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/GenerateQRCode")! 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
image/png
RESPONSE BODY text
{
"result": "string"
}
POST
Files - Resize Image
{{baseUrl}}/ResizeImage
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ResizeImage");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ResizeImage")
require "http/client"
url = "{{baseUrl}}/ResizeImage"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/ResizeImage"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/ResizeImage");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ResizeImage"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ResizeImage HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ResizeImage")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ResizeImage"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/ResizeImage")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ResizeImage")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ResizeImage');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/ResizeImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ResizeImage';
const options = {method: 'POST'};
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}}/ResizeImage',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/ResizeImage")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ResizeImage',
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: 'POST', url: '{{baseUrl}}/ResizeImage'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/ResizeImage');
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}}/ResizeImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ResizeImage';
const options = {method: 'POST'};
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}}/ResizeImage"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/ResizeImage" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ResizeImage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ResizeImage');
echo $response->getBody();
setUrl('{{baseUrl}}/ResizeImage');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/ResizeImage');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ResizeImage' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ResizeImage' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/ResizeImage", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ResizeImage"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ResizeImage"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ResizeImage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/ResizeImage') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ResizeImage";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ResizeImage
http POST {{baseUrl}}/ResizeImage
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/ResizeImage
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ResizeImage")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
image/bmp
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
image/gif
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
image/jpeg
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
image/png
RESPONSE BODY text
{
"result": "string"
}
POST
Files - Rotate Image
{{baseUrl}}/RotateImage
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/RotateImage");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/RotateImage")
require "http/client"
url = "{{baseUrl}}/RotateImage"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/RotateImage"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/RotateImage");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/RotateImage"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/RotateImage HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/RotateImage")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/RotateImage"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/RotateImage")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/RotateImage")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/RotateImage');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/RotateImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/RotateImage';
const options = {method: 'POST'};
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}}/RotateImage',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/RotateImage")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/RotateImage',
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: 'POST', url: '{{baseUrl}}/RotateImage'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/RotateImage');
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}}/RotateImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/RotateImage';
const options = {method: 'POST'};
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}}/RotateImage"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/RotateImage" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/RotateImage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/RotateImage');
echo $response->getBody();
setUrl('{{baseUrl}}/RotateImage');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/RotateImage');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/RotateImage' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/RotateImage' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/RotateImage", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/RotateImage"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/RotateImage"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/RotateImage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/RotateImage') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/RotateImage";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/RotateImage
http POST {{baseUrl}}/RotateImage
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/RotateImage
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/RotateImage")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
*/*
RESPONSE BODY text
{
"result": "string"
}
POST
Files - Watermark Image
{{baseUrl}}/WatermarkImage
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/WatermarkImage");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/WatermarkImage")
require "http/client"
url = "{{baseUrl}}/WatermarkImage"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/WatermarkImage"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/WatermarkImage");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/WatermarkImage"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/WatermarkImage HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/WatermarkImage")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/WatermarkImage"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/WatermarkImage")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/WatermarkImage")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/WatermarkImage');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/WatermarkImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/WatermarkImage';
const options = {method: 'POST'};
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}}/WatermarkImage',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/WatermarkImage")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/WatermarkImage',
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: 'POST', url: '{{baseUrl}}/WatermarkImage'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/WatermarkImage');
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}}/WatermarkImage'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/WatermarkImage';
const options = {method: 'POST'};
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}}/WatermarkImage"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/WatermarkImage" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/WatermarkImage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/WatermarkImage');
echo $response->getBody();
setUrl('{{baseUrl}}/WatermarkImage');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/WatermarkImage');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/WatermarkImage' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/WatermarkImage' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/WatermarkImage", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/WatermarkImage"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/WatermarkImage"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/WatermarkImage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/WatermarkImage') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/WatermarkImage";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/WatermarkImage
http POST {{baseUrl}}/WatermarkImage
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/WatermarkImage
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/WatermarkImage")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
*/*
RESPONSE BODY text
{
"result": "string"
}
POST
Currency - Convert currency
{{baseUrl}}/ConvertCurrency
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertCurrency");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertCurrency" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertCurrency"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertCurrency"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertCurrency");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertCurrency"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertCurrency HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertCurrency")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertCurrency"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertCurrency")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertCurrency")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertCurrency');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertCurrency',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertCurrency';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertCurrency',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertCurrency")
.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/ConvertCurrency',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertCurrency',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertCurrency');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertCurrency',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertCurrency';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertCurrency"]
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}}/ConvertCurrency" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertCurrency",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertCurrency', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertCurrency');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertCurrency');
$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}}/ConvertCurrency' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertCurrency' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertCurrency", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertCurrency"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertCurrency"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertCurrency")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertCurrency') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertCurrency";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertCurrency \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertCurrency \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertCurrency
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertCurrency")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Currency - Format currency
{{baseUrl}}/FormatCurrency
BODY json
{
"input": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/FormatCurrency");
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 \"input\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/FormatCurrency" {:content-type :json
:form-params {:input ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/FormatCurrency"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"target\": \"\"\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}}/FormatCurrency"),
Content = new StringContent("{\n \"input\": \"\",\n \"target\": \"\"\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}}/FormatCurrency");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/FormatCurrency"
payload := strings.NewReader("{\n \"input\": \"\",\n \"target\": \"\"\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/FormatCurrency HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 33
{
"input": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/FormatCurrency")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/FormatCurrency"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/FormatCurrency")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/FormatCurrency")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/FormatCurrency');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/FormatCurrency',
headers: {'content-type': 'application/json'},
data: {input: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/FormatCurrency';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","target":""}'
};
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}}/FormatCurrency',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/FormatCurrency")
.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/FormatCurrency',
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({input: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/FormatCurrency',
headers: {'content-type': 'application/json'},
body: {input: '', target: ''},
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}}/FormatCurrency');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
target: ''
});
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}}/FormatCurrency',
headers: {'content-type': 'application/json'},
data: {input: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/FormatCurrency';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","target":""}'
};
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 = @{ @"input": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/FormatCurrency"]
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}}/FormatCurrency" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/FormatCurrency",
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([
'input' => '',
'target' => ''
]),
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}}/FormatCurrency', [
'body' => '{
"input": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/FormatCurrency');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/FormatCurrency');
$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}}/FormatCurrency' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/FormatCurrency' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/FormatCurrency", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/FormatCurrency"
payload = {
"input": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/FormatCurrency"
payload <- "{\n \"input\": \"\",\n \"target\": \"\"\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}}/FormatCurrency")
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 \"input\": \"\",\n \"target\": \"\"\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/FormatCurrency') do |req|
req.body = "{\n \"input\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/FormatCurrency";
let payload = json!({
"input": "",
"target": ""
});
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}}/FormatCurrency \
--header 'content-type: application/json' \
--data '{
"input": "",
"target": ""
}'
echo '{
"input": "",
"target": ""
}' | \
http POST {{baseUrl}}/FormatCurrency \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/FormatCurrency
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/FormatCurrency")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Finance - Market index
{{baseUrl}}/MarketIndex
BODY json
{
"date": "",
"symbol": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/MarketIndex");
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 \"date\": \"\",\n \"symbol\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/MarketIndex" {:content-type :json
:form-params {:date ""
:symbol ""}})
require "http/client"
url = "{{baseUrl}}/MarketIndex"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"date\": \"\",\n \"symbol\": \"\"\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}}/MarketIndex"),
Content = new StringContent("{\n \"date\": \"\",\n \"symbol\": \"\"\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}}/MarketIndex");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"date\": \"\",\n \"symbol\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/MarketIndex"
payload := strings.NewReader("{\n \"date\": \"\",\n \"symbol\": \"\"\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/MarketIndex HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 32
{
"date": "",
"symbol": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/MarketIndex")
.setHeader("content-type", "application/json")
.setBody("{\n \"date\": \"\",\n \"symbol\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/MarketIndex"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"date\": \"\",\n \"symbol\": \"\"\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 \"date\": \"\",\n \"symbol\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/MarketIndex")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/MarketIndex")
.header("content-type", "application/json")
.body("{\n \"date\": \"\",\n \"symbol\": \"\"\n}")
.asString();
const data = JSON.stringify({
date: '',
symbol: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/MarketIndex');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/MarketIndex',
headers: {'content-type': 'application/json'},
data: {date: '', symbol: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/MarketIndex';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"date":"","symbol":""}'
};
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}}/MarketIndex',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "date": "",\n "symbol": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"date\": \"\",\n \"symbol\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/MarketIndex")
.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/MarketIndex',
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({date: '', symbol: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/MarketIndex',
headers: {'content-type': 'application/json'},
body: {date: '', symbol: ''},
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}}/MarketIndex');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
date: '',
symbol: ''
});
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}}/MarketIndex',
headers: {'content-type': 'application/json'},
data: {date: '', symbol: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/MarketIndex';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"date":"","symbol":""}'
};
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 = @{ @"date": @"",
@"symbol": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/MarketIndex"]
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}}/MarketIndex" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"date\": \"\",\n \"symbol\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/MarketIndex",
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([
'date' => '',
'symbol' => ''
]),
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}}/MarketIndex', [
'body' => '{
"date": "",
"symbol": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/MarketIndex');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'date' => '',
'symbol' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'date' => '',
'symbol' => ''
]));
$request->setRequestUrl('{{baseUrl}}/MarketIndex');
$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}}/MarketIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"date": "",
"symbol": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/MarketIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"date": "",
"symbol": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"date\": \"\",\n \"symbol\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/MarketIndex", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/MarketIndex"
payload = {
"date": "",
"symbol": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/MarketIndex"
payload <- "{\n \"date\": \"\",\n \"symbol\": \"\"\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}}/MarketIndex")
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 \"date\": \"\",\n \"symbol\": \"\"\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/MarketIndex') do |req|
req.body = "{\n \"date\": \"\",\n \"symbol\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/MarketIndex";
let payload = json!({
"date": "",
"symbol": ""
});
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}}/MarketIndex \
--header 'content-type: application/json' \
--data '{
"date": "",
"symbol": ""
}'
echo '{
"date": "",
"symbol": ""
}' | \
http POST {{baseUrl}}/MarketIndex \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "date": "",\n "symbol": ""\n}' \
--output-document \
- {{baseUrl}}/MarketIndex
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"date": "",
"symbol": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/MarketIndex")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"adj_close": 72.7,
"adj_high": 74.32,
"adj_low": 72.245,
"adj_open": 73.84,
"adj_volume": 15151304,
"close": 72.7,
"date": "2020-10-07T00:00:00+0000",
"exchange": "INDX",
"high": 74.32,
"low": 72.245,
"open": 73.84,
"symbol": "DJI.INDX",
"volume": 15151304
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Finance - Stock prices
{{baseUrl}}/StockPrices
BODY json
{
"date": "",
"exchange": "",
"symbols": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/StockPrices");
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 \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/StockPrices" {:content-type :json
:form-params {:date ""
:exchange ""
:symbols ""}})
require "http/client"
url = "{{baseUrl}}/StockPrices"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\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}}/StockPrices"),
Content = new StringContent("{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\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}}/StockPrices");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/StockPrices"
payload := strings.NewReader("{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\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/StockPrices HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"date": "",
"exchange": "",
"symbols": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/StockPrices")
.setHeader("content-type", "application/json")
.setBody("{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/StockPrices"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\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 \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/StockPrices")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/StockPrices")
.header("content-type", "application/json")
.body("{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\n}")
.asString();
const data = JSON.stringify({
date: '',
exchange: '',
symbols: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/StockPrices');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/StockPrices',
headers: {'content-type': 'application/json'},
data: {date: '', exchange: '', symbols: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/StockPrices';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"date":"","exchange":"","symbols":""}'
};
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}}/StockPrices',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "date": "",\n "exchange": "",\n "symbols": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/StockPrices")
.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/StockPrices',
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({date: '', exchange: '', symbols: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/StockPrices',
headers: {'content-type': 'application/json'},
body: {date: '', exchange: '', symbols: ''},
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}}/StockPrices');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
date: '',
exchange: '',
symbols: ''
});
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}}/StockPrices',
headers: {'content-type': 'application/json'},
data: {date: '', exchange: '', symbols: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/StockPrices';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"date":"","exchange":"","symbols":""}'
};
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 = @{ @"date": @"",
@"exchange": @"",
@"symbols": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/StockPrices"]
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}}/StockPrices" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/StockPrices",
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([
'date' => '',
'exchange' => '',
'symbols' => ''
]),
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}}/StockPrices', [
'body' => '{
"date": "",
"exchange": "",
"symbols": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/StockPrices');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'date' => '',
'exchange' => '',
'symbols' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'date' => '',
'exchange' => '',
'symbols' => ''
]));
$request->setRequestUrl('{{baseUrl}}/StockPrices');
$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}}/StockPrices' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"date": "",
"exchange": "",
"symbols": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/StockPrices' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"date": "",
"exchange": "",
"symbols": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/StockPrices", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/StockPrices"
payload = {
"date": "",
"exchange": "",
"symbols": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/StockPrices"
payload <- "{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\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}}/StockPrices")
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 \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\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/StockPrices') do |req|
req.body = "{\n \"date\": \"\",\n \"exchange\": \"\",\n \"symbols\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/StockPrices";
let payload = json!({
"date": "",
"exchange": "",
"symbols": ""
});
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}}/StockPrices \
--header 'content-type: application/json' \
--data '{
"date": "",
"exchange": "",
"symbols": ""
}'
echo '{
"date": "",
"exchange": "",
"symbols": ""
}' | \
http POST {{baseUrl}}/StockPrices \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "date": "",\n "exchange": "",\n "symbols": ""\n}' \
--output-document \
- {{baseUrl}}/StockPrices
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"date": "",
"exchange": "",
"symbols": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/StockPrices")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": [
{
"close": 72.7,
"date": "2020-10-07T00:00:00+0000",
"exchange": "XNYS",
"high": 74.32,
"last": 72.3,
"low": 72.245,
"open": 73.84,
"symbol": "CVX",
"volume": 15151304
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Absolute
{{baseUrl}}/CalculateAbsolute
BODY json
{
"decimals": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateAbsolute");
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 \"decimals\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateAbsolute" {:content-type :json
:form-params {:decimals ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/CalculateAbsolute"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateAbsolute"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateAbsolute");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateAbsolute"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\"\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/CalculateAbsolute HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateAbsolute")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateAbsolute"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateAbsolute")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateAbsolute")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateAbsolute');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateAbsolute',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateAbsolute';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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}}/CalculateAbsolute',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateAbsolute")
.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/CalculateAbsolute',
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({decimals: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateAbsolute',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: ''},
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}}/CalculateAbsolute');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: ''
});
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}}/CalculateAbsolute',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateAbsolute';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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 = @{ @"decimals": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateAbsolute"]
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}}/CalculateAbsolute" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateAbsolute",
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([
'decimals' => '',
'input' => ''
]),
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}}/CalculateAbsolute', [
'body' => '{
"decimals": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateAbsolute');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateAbsolute');
$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}}/CalculateAbsolute' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateAbsolute' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateAbsolute", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateAbsolute"
payload = {
"decimals": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateAbsolute"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateAbsolute")
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 \"decimals\": \"\",\n \"input\": \"\"\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/CalculateAbsolute') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateAbsolute";
let payload = json!({
"decimals": "",
"input": ""
});
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}}/CalculateAbsolute \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": ""
}'
echo '{
"decimals": "",
"input": ""
}' | \
http POST {{baseUrl}}/CalculateAbsolute \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateAbsolute
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateAbsolute")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Addition
{{baseUrl}}/CalculateAddition
BODY json
{
"decimals": "",
"input": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateAddition");
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateAddition" {:content-type :json
:form-params {:decimals ""
:input ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/CalculateAddition"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateAddition"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateAddition");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateAddition"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateAddition HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"decimals": "",
"input": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateAddition")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateAddition"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateAddition")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateAddition")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateAddition');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateAddition',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateAddition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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}}/CalculateAddition',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateAddition")
.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/CalculateAddition',
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({decimals: '', input: '', value: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateAddition',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: '', value: ''},
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}}/CalculateAddition');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: '',
value: ''
});
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}}/CalculateAddition',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateAddition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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 = @{ @"decimals": @"",
@"input": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateAddition"]
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}}/CalculateAddition" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateAddition",
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([
'decimals' => '',
'input' => '',
'value' => ''
]),
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}}/CalculateAddition', [
'body' => '{
"decimals": "",
"input": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateAddition');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateAddition');
$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}}/CalculateAddition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateAddition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateAddition", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateAddition"
payload = {
"decimals": "",
"input": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateAddition"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateAddition")
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateAddition') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateAddition";
let payload = json!({
"decimals": "",
"input": "",
"value": ""
});
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}}/CalculateAddition \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": "",
"value": ""
}'
echo '{
"decimals": "",
"input": "",
"value": ""
}' | \
http POST {{baseUrl}}/CalculateAddition \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateAddition
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateAddition")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Cosine
{{baseUrl}}/CalculateCosine
BODY json
{
"decimals": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateCosine");
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 \"decimals\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateCosine" {:content-type :json
:form-params {:decimals ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/CalculateCosine"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateCosine"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateCosine");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateCosine"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\"\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/CalculateCosine HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateCosine")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateCosine"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateCosine")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateCosine")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateCosine');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateCosine',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateCosine';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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}}/CalculateCosine',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateCosine")
.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/CalculateCosine',
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({decimals: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateCosine',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: ''},
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}}/CalculateCosine');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: ''
});
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}}/CalculateCosine',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateCosine';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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 = @{ @"decimals": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateCosine"]
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}}/CalculateCosine" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateCosine",
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([
'decimals' => '',
'input' => ''
]),
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}}/CalculateCosine', [
'body' => '{
"decimals": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateCosine');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateCosine');
$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}}/CalculateCosine' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateCosine' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateCosine", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateCosine"
payload = {
"decimals": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateCosine"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateCosine")
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 \"decimals\": \"\",\n \"input\": \"\"\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/CalculateCosine') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateCosine";
let payload = json!({
"decimals": "",
"input": ""
});
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}}/CalculateCosine \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": ""
}'
echo '{
"decimals": "",
"input": ""
}' | \
http POST {{baseUrl}}/CalculateCosine \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateCosine
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateCosine")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Division
{{baseUrl}}/CalculateDivision
BODY json
{
"decimals": "",
"input": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateDivision");
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateDivision" {:content-type :json
:form-params {:decimals ""
:input ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/CalculateDivision"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateDivision"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateDivision");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateDivision"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateDivision HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"decimals": "",
"input": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateDivision")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateDivision"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateDivision")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateDivision")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateDivision');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateDivision',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateDivision';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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}}/CalculateDivision',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateDivision")
.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/CalculateDivision',
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({decimals: '', input: '', value: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateDivision',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: '', value: ''},
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}}/CalculateDivision');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: '',
value: ''
});
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}}/CalculateDivision',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateDivision';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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 = @{ @"decimals": @"",
@"input": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateDivision"]
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}}/CalculateDivision" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateDivision",
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([
'decimals' => '',
'input' => '',
'value' => ''
]),
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}}/CalculateDivision', [
'body' => '{
"decimals": "",
"input": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateDivision');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateDivision');
$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}}/CalculateDivision' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateDivision' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateDivision", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateDivision"
payload = {
"decimals": "",
"input": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateDivision"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateDivision")
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateDivision') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateDivision";
let payload = json!({
"decimals": "",
"input": "",
"value": ""
});
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}}/CalculateDivision \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": "",
"value": ""
}'
echo '{
"decimals": "",
"input": "",
"value": ""
}' | \
http POST {{baseUrl}}/CalculateDivision \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateDivision
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateDivision")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Logarithm
{{baseUrl}}/CalculateLogarithm
BODY json
{
"decimals": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateLogarithm");
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 \"decimals\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateLogarithm" {:content-type :json
:form-params {:decimals ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/CalculateLogarithm"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateLogarithm"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateLogarithm");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateLogarithm"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\"\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/CalculateLogarithm HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateLogarithm")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateLogarithm"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateLogarithm")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateLogarithm")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateLogarithm');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateLogarithm',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateLogarithm';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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}}/CalculateLogarithm',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateLogarithm")
.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/CalculateLogarithm',
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({decimals: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateLogarithm',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: ''},
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}}/CalculateLogarithm');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: ''
});
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}}/CalculateLogarithm',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateLogarithm';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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 = @{ @"decimals": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateLogarithm"]
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}}/CalculateLogarithm" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateLogarithm",
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([
'decimals' => '',
'input' => ''
]),
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}}/CalculateLogarithm', [
'body' => '{
"decimals": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateLogarithm');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateLogarithm');
$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}}/CalculateLogarithm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateLogarithm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateLogarithm", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateLogarithm"
payload = {
"decimals": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateLogarithm"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateLogarithm")
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 \"decimals\": \"\",\n \"input\": \"\"\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/CalculateLogarithm') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateLogarithm";
let payload = json!({
"decimals": "",
"input": ""
});
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}}/CalculateLogarithm \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": ""
}'
echo '{
"decimals": "",
"input": ""
}' | \
http POST {{baseUrl}}/CalculateLogarithm \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateLogarithm
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateLogarithm")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Modulo
{{baseUrl}}/CalculateModulo
BODY json
{
"decimals": "",
"input": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateModulo");
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateModulo" {:content-type :json
:form-params {:decimals ""
:input ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/CalculateModulo"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateModulo"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateModulo");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateModulo"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateModulo HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"decimals": "",
"input": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateModulo")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateModulo"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateModulo")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateModulo")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateModulo');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateModulo',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateModulo';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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}}/CalculateModulo',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateModulo")
.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/CalculateModulo',
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({decimals: '', input: '', value: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateModulo',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: '', value: ''},
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}}/CalculateModulo');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: '',
value: ''
});
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}}/CalculateModulo',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateModulo';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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 = @{ @"decimals": @"",
@"input": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateModulo"]
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}}/CalculateModulo" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateModulo",
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([
'decimals' => '',
'input' => '',
'value' => ''
]),
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}}/CalculateModulo', [
'body' => '{
"decimals": "",
"input": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateModulo');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateModulo');
$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}}/CalculateModulo' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateModulo' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateModulo", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateModulo"
payload = {
"decimals": "",
"input": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateModulo"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateModulo")
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateModulo') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateModulo";
let payload = json!({
"decimals": "",
"input": "",
"value": ""
});
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}}/CalculateModulo \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": "",
"value": ""
}'
echo '{
"decimals": "",
"input": "",
"value": ""
}' | \
http POST {{baseUrl}}/CalculateModulo \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateModulo
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateModulo")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Multiplication
{{baseUrl}}/CalculateMultiplication
BODY json
{
"decimals": "",
"input": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateMultiplication");
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateMultiplication" {:content-type :json
:form-params {:decimals ""
:input ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/CalculateMultiplication"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateMultiplication"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateMultiplication");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateMultiplication"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateMultiplication HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"decimals": "",
"input": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateMultiplication")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateMultiplication"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateMultiplication")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateMultiplication")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateMultiplication');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateMultiplication',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateMultiplication';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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}}/CalculateMultiplication',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateMultiplication")
.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/CalculateMultiplication',
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({decimals: '', input: '', value: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateMultiplication',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: '', value: ''},
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}}/CalculateMultiplication');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: '',
value: ''
});
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}}/CalculateMultiplication',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateMultiplication';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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 = @{ @"decimals": @"",
@"input": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateMultiplication"]
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}}/CalculateMultiplication" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateMultiplication",
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([
'decimals' => '',
'input' => '',
'value' => ''
]),
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}}/CalculateMultiplication', [
'body' => '{
"decimals": "",
"input": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateMultiplication');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateMultiplication');
$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}}/CalculateMultiplication' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateMultiplication' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateMultiplication", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateMultiplication"
payload = {
"decimals": "",
"input": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateMultiplication"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateMultiplication")
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateMultiplication') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateMultiplication";
let payload = json!({
"decimals": "",
"input": "",
"value": ""
});
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}}/CalculateMultiplication \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": "",
"value": ""
}'
echo '{
"decimals": "",
"input": "",
"value": ""
}' | \
http POST {{baseUrl}}/CalculateMultiplication \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateMultiplication
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateMultiplication")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Nth Root
{{baseUrl}}/CalculateNthRoot
BODY json
{
"decimals": "",
"input": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateNthRoot");
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateNthRoot" {:content-type :json
:form-params {:decimals ""
:input ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/CalculateNthRoot"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateNthRoot"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateNthRoot");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateNthRoot"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateNthRoot HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"decimals": "",
"input": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateNthRoot")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateNthRoot"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateNthRoot")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateNthRoot")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateNthRoot');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateNthRoot',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateNthRoot';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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}}/CalculateNthRoot',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateNthRoot")
.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/CalculateNthRoot',
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({decimals: '', input: '', value: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateNthRoot',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: '', value: ''},
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}}/CalculateNthRoot');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: '',
value: ''
});
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}}/CalculateNthRoot',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateNthRoot';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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 = @{ @"decimals": @"",
@"input": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateNthRoot"]
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}}/CalculateNthRoot" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateNthRoot",
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([
'decimals' => '',
'input' => '',
'value' => ''
]),
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}}/CalculateNthRoot', [
'body' => '{
"decimals": "",
"input": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateNthRoot');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateNthRoot');
$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}}/CalculateNthRoot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateNthRoot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateNthRoot", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateNthRoot"
payload = {
"decimals": "",
"input": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateNthRoot"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateNthRoot")
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateNthRoot') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateNthRoot";
let payload = json!({
"decimals": "",
"input": "",
"value": ""
});
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}}/CalculateNthRoot \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": "",
"value": ""
}'
echo '{
"decimals": "",
"input": "",
"value": ""
}' | \
http POST {{baseUrl}}/CalculateNthRoot \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateNthRoot
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateNthRoot")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Sine
{{baseUrl}}/CalculateSine
BODY json
{
"decimals": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateSine");
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 \"decimals\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateSine" {:content-type :json
:form-params {:decimals ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/CalculateSine"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateSine"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateSine");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateSine"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\"\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/CalculateSine HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateSine")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateSine"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateSine")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateSine")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateSine');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateSine',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateSine';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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}}/CalculateSine',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateSine")
.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/CalculateSine',
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({decimals: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateSine',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: ''},
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}}/CalculateSine');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: ''
});
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}}/CalculateSine',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateSine';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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 = @{ @"decimals": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateSine"]
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}}/CalculateSine" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateSine",
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([
'decimals' => '',
'input' => ''
]),
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}}/CalculateSine', [
'body' => '{
"decimals": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateSine');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateSine');
$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}}/CalculateSine' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateSine' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateSine", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateSine"
payload = {
"decimals": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateSine"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateSine")
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 \"decimals\": \"\",\n \"input\": \"\"\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/CalculateSine') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateSine";
let payload = json!({
"decimals": "",
"input": ""
});
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}}/CalculateSine \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": ""
}'
echo '{
"decimals": "",
"input": ""
}' | \
http POST {{baseUrl}}/CalculateSine \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateSine
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateSine")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Square Root
{{baseUrl}}/CalculateSquareRoot
BODY json
{
"decimals": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateSquareRoot");
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 \"decimals\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateSquareRoot" {:content-type :json
:form-params {:decimals ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/CalculateSquareRoot"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateSquareRoot"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateSquareRoot");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateSquareRoot"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\"\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/CalculateSquareRoot HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateSquareRoot")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateSquareRoot"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateSquareRoot")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateSquareRoot")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateSquareRoot');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateSquareRoot',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateSquareRoot';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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}}/CalculateSquareRoot',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateSquareRoot")
.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/CalculateSquareRoot',
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({decimals: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateSquareRoot',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: ''},
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}}/CalculateSquareRoot');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: ''
});
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}}/CalculateSquareRoot',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateSquareRoot';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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 = @{ @"decimals": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateSquareRoot"]
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}}/CalculateSquareRoot" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateSquareRoot",
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([
'decimals' => '',
'input' => ''
]),
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}}/CalculateSquareRoot', [
'body' => '{
"decimals": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateSquareRoot');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateSquareRoot');
$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}}/CalculateSquareRoot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateSquareRoot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateSquareRoot", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateSquareRoot"
payload = {
"decimals": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateSquareRoot"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateSquareRoot")
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 \"decimals\": \"\",\n \"input\": \"\"\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/CalculateSquareRoot') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateSquareRoot";
let payload = json!({
"decimals": "",
"input": ""
});
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}}/CalculateSquareRoot \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": ""
}'
echo '{
"decimals": "",
"input": ""
}' | \
http POST {{baseUrl}}/CalculateSquareRoot \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateSquareRoot
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateSquareRoot")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Subtraction
{{baseUrl}}/CalculateSubtraction
BODY json
{
"decimals": "",
"input": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateSubtraction");
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateSubtraction" {:content-type :json
:form-params {:decimals ""
:input ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/CalculateSubtraction"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateSubtraction"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateSubtraction");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateSubtraction"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateSubtraction HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"decimals": "",
"input": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateSubtraction")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateSubtraction"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateSubtraction")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateSubtraction")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateSubtraction');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateSubtraction',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateSubtraction';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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}}/CalculateSubtraction',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateSubtraction")
.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/CalculateSubtraction',
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({decimals: '', input: '', value: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateSubtraction',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: '', value: ''},
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}}/CalculateSubtraction');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: '',
value: ''
});
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}}/CalculateSubtraction',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateSubtraction';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","value":""}'
};
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 = @{ @"decimals": @"",
@"input": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateSubtraction"]
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}}/CalculateSubtraction" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateSubtraction",
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([
'decimals' => '',
'input' => '',
'value' => ''
]),
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}}/CalculateSubtraction', [
'body' => '{
"decimals": "",
"input": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateSubtraction');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateSubtraction');
$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}}/CalculateSubtraction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateSubtraction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateSubtraction", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateSubtraction"
payload = {
"decimals": "",
"input": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateSubtraction"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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}}/CalculateSubtraction")
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 \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\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/CalculateSubtraction') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"value\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateSubtraction";
let payload = json!({
"decimals": "",
"input": "",
"value": ""
});
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}}/CalculateSubtraction \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": "",
"value": ""
}'
echo '{
"decimals": "",
"input": "",
"value": ""
}' | \
http POST {{baseUrl}}/CalculateSubtraction \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateSubtraction
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateSubtraction")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate Tangent
{{baseUrl}}/CalculateTangent
BODY json
{
"decimals": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateTangent");
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 \"decimals\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateTangent" {:content-type :json
:form-params {:decimals ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/CalculateTangent"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateTangent"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateTangent");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateTangent"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\"\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/CalculateTangent HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateTangent")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateTangent"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateTangent")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateTangent")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateTangent');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateTangent',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateTangent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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}}/CalculateTangent',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateTangent")
.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/CalculateTangent',
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({decimals: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateTangent',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: ''},
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}}/CalculateTangent');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: ''
});
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}}/CalculateTangent',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateTangent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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 = @{ @"decimals": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateTangent"]
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}}/CalculateTangent" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateTangent",
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([
'decimals' => '',
'input' => ''
]),
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}}/CalculateTangent', [
'body' => '{
"decimals": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateTangent');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateTangent');
$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}}/CalculateTangent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateTangent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateTangent", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateTangent"
payload = {
"decimals": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateTangent"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/CalculateTangent")
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 \"decimals\": \"\",\n \"input\": \"\"\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/CalculateTangent') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateTangent";
let payload = json!({
"decimals": "",
"input": ""
});
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}}/CalculateTangent \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": ""
}'
echo '{
"decimals": "",
"input": ""
}' | \
http POST {{baseUrl}}/CalculateTangent \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateTangent
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateTangent")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate average
{{baseUrl}}/CalculateAverage
BODY json
{
"decimals": "",
"input": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateAverage");
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 \"decimals\": \"\",\n \"input\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateAverage" {:content-type :json
:form-params {:decimals ""
:input []}})
require "http/client"
url = "{{baseUrl}}/CalculateAverage"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateAverage"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateAverage");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateAverage"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": []\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/CalculateAverage HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateAverage")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateAverage"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": []\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 \"decimals\": \"\",\n \"input\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateAverage")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateAverage")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": []\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateAverage');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateAverage',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateAverage';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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}}/CalculateAverage',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateAverage")
.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/CalculateAverage',
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({decimals: '', input: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateAverage',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: []},
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}}/CalculateAverage');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: []
});
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}}/CalculateAverage',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateAverage';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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 = @{ @"decimals": @"",
@"input": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateAverage"]
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}}/CalculateAverage" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateAverage",
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([
'decimals' => '',
'input' => [
]
]),
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}}/CalculateAverage', [
'body' => '{
"decimals": "",
"input": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateAverage');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/CalculateAverage');
$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}}/CalculateAverage' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateAverage' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateAverage", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateAverage"
payload = {
"decimals": "",
"input": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateAverage"
payload <- "{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateAverage")
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 \"decimals\": \"\",\n \"input\": []\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/CalculateAverage') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateAverage";
let payload = json!({
"decimals": "",
"input": ()
});
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}}/CalculateAverage \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": []
}'
echo '{
"decimals": "",
"input": []
}' | \
http POST {{baseUrl}}/CalculateAverage \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": []\n}' \
--output-document \
- {{baseUrl}}/CalculateAverage
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateAverage")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate median
{{baseUrl}}/CalculateMedian
BODY json
{
"decimals": "",
"input": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateMedian");
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 \"decimals\": \"\",\n \"input\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateMedian" {:content-type :json
:form-params {:decimals ""
:input []}})
require "http/client"
url = "{{baseUrl}}/CalculateMedian"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateMedian"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateMedian");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateMedian"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": []\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/CalculateMedian HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateMedian")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateMedian"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": []\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 \"decimals\": \"\",\n \"input\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateMedian")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateMedian")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": []\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateMedian');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateMedian',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateMedian';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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}}/CalculateMedian',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateMedian")
.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/CalculateMedian',
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({decimals: '', input: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateMedian',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: []},
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}}/CalculateMedian');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: []
});
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}}/CalculateMedian',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateMedian';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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 = @{ @"decimals": @"",
@"input": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateMedian"]
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}}/CalculateMedian" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateMedian",
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([
'decimals' => '',
'input' => [
]
]),
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}}/CalculateMedian', [
'body' => '{
"decimals": "",
"input": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateMedian');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/CalculateMedian');
$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}}/CalculateMedian' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateMedian' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateMedian", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateMedian"
payload = {
"decimals": "",
"input": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateMedian"
payload <- "{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateMedian")
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 \"decimals\": \"\",\n \"input\": []\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/CalculateMedian') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateMedian";
let payload = json!({
"decimals": "",
"input": ()
});
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}}/CalculateMedian \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": []
}'
echo '{
"decimals": "",
"input": []
}' | \
http POST {{baseUrl}}/CalculateMedian \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": []\n}' \
--output-document \
- {{baseUrl}}/CalculateMedian
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateMedian")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate minimum or maximum
{{baseUrl}}/CalculateMinMax
BODY json
{
"input": [],
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateMinMax");
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 \"input\": [],\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateMinMax" {:content-type :json
:form-params {:input []
:type ""}})
require "http/client"
url = "{{baseUrl}}/CalculateMinMax"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": [],\n \"type\": \"\"\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}}/CalculateMinMax"),
Content = new StringContent("{\n \"input\": [],\n \"type\": \"\"\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}}/CalculateMinMax");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": [],\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateMinMax"
payload := strings.NewReader("{\n \"input\": [],\n \"type\": \"\"\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/CalculateMinMax HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 31
{
"input": [],
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateMinMax")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": [],\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateMinMax"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": [],\n \"type\": \"\"\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 \"input\": [],\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateMinMax")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateMinMax")
.header("content-type", "application/json")
.body("{\n \"input\": [],\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: [],
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateMinMax');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateMinMax',
headers: {'content-type': 'application/json'},
data: {input: [], type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateMinMax';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"type":""}'
};
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}}/CalculateMinMax',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": [],\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": [],\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateMinMax")
.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/CalculateMinMax',
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({input: [], type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateMinMax',
headers: {'content-type': 'application/json'},
body: {input: [], type: ''},
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}}/CalculateMinMax');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: [],
type: ''
});
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}}/CalculateMinMax',
headers: {'content-type': 'application/json'},
data: {input: [], type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateMinMax';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"type":""}'
};
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 = @{ @"input": @[ ],
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateMinMax"]
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}}/CalculateMinMax" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": [],\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateMinMax",
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([
'input' => [
],
'type' => ''
]),
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}}/CalculateMinMax', [
'body' => '{
"input": [],
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateMinMax');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => [
],
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => [
],
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculateMinMax');
$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}}/CalculateMinMax' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateMinMax' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": [],\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateMinMax", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateMinMax"
payload = {
"input": [],
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateMinMax"
payload <- "{\n \"input\": [],\n \"type\": \"\"\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}}/CalculateMinMax")
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 \"input\": [],\n \"type\": \"\"\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/CalculateMinMax') do |req|
req.body = "{\n \"input\": [],\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateMinMax";
let payload = json!({
"input": (),
"type": ""
});
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}}/CalculateMinMax \
--header 'content-type: application/json' \
--data '{
"input": [],
"type": ""
}'
echo '{
"input": [],
"type": ""
}' | \
http POST {{baseUrl}}/CalculateMinMax \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": [],\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/CalculateMinMax
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": [],
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateMinMax")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate power
{{baseUrl}}/CalculatePower
BODY json
{
"decimals": "",
"input": "",
"power": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculatePower");
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 \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculatePower" {:content-type :json
:form-params {:decimals ""
:input ""
:power ""}})
require "http/client"
url = "{{baseUrl}}/CalculatePower"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\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}}/CalculatePower"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\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}}/CalculatePower");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculatePower"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\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/CalculatePower HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"decimals": "",
"input": "",
"power": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculatePower")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculatePower"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculatePower")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculatePower")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: '',
power: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculatePower');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculatePower',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', power: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculatePower';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","power":""}'
};
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}}/CalculatePower',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": "",\n "power": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculatePower")
.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/CalculatePower',
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({decimals: '', input: '', power: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculatePower',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: '', power: ''},
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}}/CalculatePower');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: '',
power: ''
});
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}}/CalculatePower',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: '', power: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculatePower';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":"","power":""}'
};
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 = @{ @"decimals": @"",
@"input": @"",
@"power": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculatePower"]
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}}/CalculatePower" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculatePower",
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([
'decimals' => '',
'input' => '',
'power' => ''
]),
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}}/CalculatePower', [
'body' => '{
"decimals": "",
"input": "",
"power": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculatePower');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => '',
'power' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => '',
'power' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CalculatePower');
$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}}/CalculatePower' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"power": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculatePower' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": "",
"power": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculatePower", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculatePower"
payload = {
"decimals": "",
"input": "",
"power": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculatePower"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\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}}/CalculatePower")
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 \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\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/CalculatePower') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\",\n \"power\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculatePower";
let payload = json!({
"decimals": "",
"input": "",
"power": ""
});
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}}/CalculatePower \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": "",
"power": ""
}'
echo '{
"decimals": "",
"input": "",
"power": ""
}' | \
http POST {{baseUrl}}/CalculatePower \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": "",\n "power": ""\n}' \
--output-document \
- {{baseUrl}}/CalculatePower
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": "",
"power": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculatePower")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate standard deviation
{{baseUrl}}/StandardDeviation
BODY json
{
"decimals": "",
"input": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/StandardDeviation");
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 \"decimals\": \"\",\n \"input\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/StandardDeviation" {:content-type :json
:form-params {:decimals ""
:input []}})
require "http/client"
url = "{{baseUrl}}/StandardDeviation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": []\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}}/StandardDeviation"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": []\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}}/StandardDeviation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/StandardDeviation"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": []\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/StandardDeviation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/StandardDeviation")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/StandardDeviation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": []\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 \"decimals\": \"\",\n \"input\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/StandardDeviation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/StandardDeviation")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": []\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/StandardDeviation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/StandardDeviation',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/StandardDeviation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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}}/StandardDeviation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/StandardDeviation")
.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/StandardDeviation',
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({decimals: '', input: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/StandardDeviation',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: []},
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}}/StandardDeviation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: []
});
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}}/StandardDeviation',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/StandardDeviation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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 = @{ @"decimals": @"",
@"input": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/StandardDeviation"]
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}}/StandardDeviation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/StandardDeviation",
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([
'decimals' => '',
'input' => [
]
]),
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}}/StandardDeviation', [
'body' => '{
"decimals": "",
"input": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/StandardDeviation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/StandardDeviation');
$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}}/StandardDeviation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/StandardDeviation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/StandardDeviation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/StandardDeviation"
payload = {
"decimals": "",
"input": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/StandardDeviation"
payload <- "{\n \"decimals\": \"\",\n \"input\": []\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}}/StandardDeviation")
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 \"decimals\": \"\",\n \"input\": []\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/StandardDeviation') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/StandardDeviation";
let payload = json!({
"decimals": "",
"input": ()
});
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}}/StandardDeviation \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": []
}'
echo '{
"decimals": "",
"input": []
}' | \
http POST {{baseUrl}}/StandardDeviation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": []\n}' \
--output-document \
- {{baseUrl}}/StandardDeviation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/StandardDeviation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate sum
{{baseUrl}}/CalculateSum
BODY json
{
"decimals": "",
"input": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateSum");
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 \"decimals\": \"\",\n \"input\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateSum" {:content-type :json
:form-params {:decimals ""
:input []}})
require "http/client"
url = "{{baseUrl}}/CalculateSum"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateSum"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateSum");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateSum"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": []\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/CalculateSum HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateSum")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateSum"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": []\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 \"decimals\": \"\",\n \"input\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateSum")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateSum")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": []\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateSum');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateSum',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateSum';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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}}/CalculateSum',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateSum")
.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/CalculateSum',
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({decimals: '', input: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateSum',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: []},
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}}/CalculateSum');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: []
});
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}}/CalculateSum',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateSum';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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 = @{ @"decimals": @"",
@"input": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateSum"]
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}}/CalculateSum" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateSum",
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([
'decimals' => '',
'input' => [
]
]),
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}}/CalculateSum', [
'body' => '{
"decimals": "",
"input": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateSum');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/CalculateSum');
$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}}/CalculateSum' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateSum' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateSum", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateSum"
payload = {
"decimals": "",
"input": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateSum"
payload <- "{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateSum")
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 \"decimals\": \"\",\n \"input\": []\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/CalculateSum') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateSum";
let payload = json!({
"decimals": "",
"input": ()
});
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}}/CalculateSum \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": []
}'
echo '{
"decimals": "",
"input": []
}' | \
http POST {{baseUrl}}/CalculateSum \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": []\n}' \
--output-document \
- {{baseUrl}}/CalculateSum
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateSum")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Calculate variance
{{baseUrl}}/CalculateVariance
BODY json
{
"decimals": "",
"input": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CalculateVariance");
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 \"decimals\": \"\",\n \"input\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CalculateVariance" {:content-type :json
:form-params {:decimals ""
:input []}})
require "http/client"
url = "{{baseUrl}}/CalculateVariance"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateVariance"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateVariance");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CalculateVariance"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": []\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/CalculateVariance HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CalculateVariance")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CalculateVariance"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": []\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 \"decimals\": \"\",\n \"input\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CalculateVariance")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CalculateVariance")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": []\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CalculateVariance');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateVariance',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CalculateVariance';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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}}/CalculateVariance',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CalculateVariance")
.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/CalculateVariance',
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({decimals: '', input: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CalculateVariance',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: []},
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}}/CalculateVariance');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: []
});
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}}/CalculateVariance',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CalculateVariance';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":[]}'
};
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 = @{ @"decimals": @"",
@"input": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CalculateVariance"]
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}}/CalculateVariance" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CalculateVariance",
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([
'decimals' => '',
'input' => [
]
]),
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}}/CalculateVariance', [
'body' => '{
"decimals": "",
"input": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CalculateVariance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/CalculateVariance');
$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}}/CalculateVariance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CalculateVariance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CalculateVariance", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CalculateVariance"
payload = {
"decimals": "",
"input": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CalculateVariance"
payload <- "{\n \"decimals\": \"\",\n \"input\": []\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}}/CalculateVariance")
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 \"decimals\": \"\",\n \"input\": []\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/CalculateVariance') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CalculateVariance";
let payload = json!({
"decimals": "",
"input": ()
});
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}}/CalculateVariance \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": []
}'
echo '{
"decimals": "",
"input": []
}' | \
http POST {{baseUrl}}/CalculateVariance \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": []\n}' \
--output-document \
- {{baseUrl}}/CalculateVariance
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CalculateVariance")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert angle
{{baseUrl}}/ConvertAngle
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertAngle");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertAngle" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertAngle"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertAngle"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertAngle");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertAngle"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertAngle HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertAngle")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertAngle"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertAngle")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertAngle")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertAngle');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertAngle',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertAngle';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertAngle',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertAngle")
.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/ConvertAngle',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertAngle',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertAngle');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertAngle',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertAngle';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertAngle"]
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}}/ConvertAngle" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertAngle",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertAngle', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertAngle');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertAngle');
$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}}/ConvertAngle' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertAngle' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertAngle", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertAngle"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertAngle"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertAngle")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertAngle') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertAngle";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertAngle \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertAngle \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertAngle
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertAngle")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert area
{{baseUrl}}/ConvertArea
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertArea");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertArea" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertArea"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertArea"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertArea");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertArea"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertArea HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertArea")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertArea"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertArea")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertArea")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertArea');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertArea',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertArea';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertArea',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertArea")
.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/ConvertArea',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertArea',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertArea');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertArea',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertArea';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertArea"]
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}}/ConvertArea" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertArea",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertArea', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertArea');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertArea');
$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}}/ConvertArea' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertArea' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertArea", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertArea"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertArea"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertArea")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertArea') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertArea";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertArea \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertArea \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertArea
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertArea")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert distance
{{baseUrl}}/ConvertDistance
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertDistance");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertDistance" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertDistance"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertDistance"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertDistance");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertDistance"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertDistance HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertDistance")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertDistance"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertDistance")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertDistance")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertDistance');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertDistance',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertDistance';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertDistance',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertDistance")
.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/ConvertDistance',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertDistance',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertDistance');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertDistance',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertDistance';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertDistance"]
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}}/ConvertDistance" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertDistance",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertDistance', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertDistance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertDistance');
$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}}/ConvertDistance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertDistance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertDistance", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertDistance"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertDistance"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertDistance")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertDistance') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertDistance";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertDistance \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertDistance \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertDistance
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertDistance")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert duration
{{baseUrl}}/ConvertDuration
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertDuration");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertDuration" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertDuration"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertDuration"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertDuration");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertDuration"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertDuration HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertDuration")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertDuration"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertDuration")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertDuration")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertDuration');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertDuration',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertDuration';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertDuration',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertDuration")
.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/ConvertDuration',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertDuration',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertDuration');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertDuration',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertDuration';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertDuration"]
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}}/ConvertDuration" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertDuration",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertDuration', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertDuration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertDuration');
$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}}/ConvertDuration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertDuration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertDuration", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertDuration"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertDuration"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertDuration")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertDuration') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertDuration";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertDuration \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertDuration \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertDuration
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertDuration")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert energy
{{baseUrl}}/ConvertEnergy
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertEnergy");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertEnergy" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertEnergy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertEnergy"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertEnergy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertEnergy"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertEnergy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertEnergy")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertEnergy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertEnergy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertEnergy")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertEnergy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertEnergy',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertEnergy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertEnergy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertEnergy")
.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/ConvertEnergy',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertEnergy',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertEnergy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertEnergy',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertEnergy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertEnergy"]
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}}/ConvertEnergy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertEnergy",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertEnergy', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertEnergy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertEnergy');
$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}}/ConvertEnergy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertEnergy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertEnergy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertEnergy"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertEnergy"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertEnergy")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertEnergy') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertEnergy";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertEnergy \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertEnergy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertEnergy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertEnergy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert power
{{baseUrl}}/ConvertPower
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertPower");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertPower" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertPower"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertPower"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertPower");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertPower"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertPower HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertPower")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertPower"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertPower")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertPower")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertPower');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertPower',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertPower';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertPower',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertPower")
.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/ConvertPower',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertPower',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertPower');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertPower',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertPower';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertPower"]
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}}/ConvertPower" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertPower",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertPower', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertPower');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertPower');
$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}}/ConvertPower' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertPower' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertPower", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertPower"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertPower"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertPower")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertPower') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertPower";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertPower \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertPower \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertPower
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertPower")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert speed
{{baseUrl}}/ConvertSpeed
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertSpeed");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertSpeed" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertSpeed"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertSpeed"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertSpeed");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertSpeed"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertSpeed HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertSpeed")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertSpeed"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertSpeed")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertSpeed")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertSpeed');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertSpeed',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertSpeed';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertSpeed',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertSpeed")
.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/ConvertSpeed',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertSpeed',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertSpeed');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertSpeed',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertSpeed';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertSpeed"]
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}}/ConvertSpeed" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertSpeed",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertSpeed', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertSpeed');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertSpeed');
$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}}/ConvertSpeed' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertSpeed' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertSpeed", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertSpeed"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertSpeed"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertSpeed")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertSpeed') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertSpeed";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertSpeed \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertSpeed \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertSpeed
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertSpeed")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert temperature
{{baseUrl}}/ConvertTemperature
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertTemperature");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertTemperature" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertTemperature"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertTemperature"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertTemperature");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertTemperature"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertTemperature HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertTemperature")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertTemperature"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertTemperature")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertTemperature")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertTemperature');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertTemperature',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertTemperature';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertTemperature',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertTemperature")
.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/ConvertTemperature',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertTemperature',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertTemperature');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertTemperature',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertTemperature';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertTemperature"]
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}}/ConvertTemperature" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertTemperature",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertTemperature', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertTemperature');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertTemperature');
$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}}/ConvertTemperature' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertTemperature' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertTemperature", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertTemperature"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertTemperature"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertTemperature")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertTemperature') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertTemperature";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertTemperature \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertTemperature \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertTemperature
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertTemperature")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert volume
{{baseUrl}}/ConvertVolume
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertVolume");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertVolume" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertVolume"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertVolume"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertVolume");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertVolume"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertVolume HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertVolume")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertVolume"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertVolume")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertVolume")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertVolume');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertVolume',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertVolume';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertVolume',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertVolume")
.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/ConvertVolume',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertVolume',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertVolume');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertVolume',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertVolume';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertVolume"]
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}}/ConvertVolume" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertVolume",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertVolume', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertVolume');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertVolume');
$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}}/ConvertVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertVolume", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertVolume"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertVolume"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertVolume")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertVolume') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertVolume";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertVolume \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertVolume \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertVolume
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertVolume")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Convert weight
{{baseUrl}}/ConvertWeight
BODY json
{
"input": "",
"source": "",
"target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertWeight");
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertWeight" {:content-type :json
:form-params {:input ""
:source ""
:target ""}})
require "http/client"
url = "{{baseUrl}}/ConvertWeight"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertWeight"),
Content = new StringContent("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertWeight");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertWeight"
payload := strings.NewReader("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertWeight HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"input": "",
"source": "",
"target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertWeight")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertWeight"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertWeight")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertWeight")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
source: '',
target: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertWeight');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertWeight',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertWeight';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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}}/ConvertWeight',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "source": "",\n "target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertWeight")
.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/ConvertWeight',
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({input: '', source: '', target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertWeight',
headers: {'content-type': 'application/json'},
body: {input: '', source: '', target: ''},
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}}/ConvertWeight');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
source: '',
target: ''
});
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}}/ConvertWeight',
headers: {'content-type': 'application/json'},
data: {input: '', source: '', target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertWeight';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","source":"","target":""}'
};
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 = @{ @"input": @"",
@"source": @"",
@"target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertWeight"]
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}}/ConvertWeight" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertWeight",
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([
'input' => '',
'source' => '',
'target' => ''
]),
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}}/ConvertWeight', [
'body' => '{
"input": "",
"source": "",
"target": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertWeight');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'source' => '',
'target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertWeight');
$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}}/ConvertWeight' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertWeight' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"source": "",
"target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertWeight", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertWeight"
payload = {
"input": "",
"source": "",
"target": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertWeight"
payload <- "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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}}/ConvertWeight")
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 \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\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/ConvertWeight') do |req|
req.body = "{\n \"input\": \"\",\n \"source\": \"\",\n \"target\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertWeight";
let payload = json!({
"input": "",
"source": "",
"target": ""
});
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}}/ConvertWeight \
--header 'content-type: application/json' \
--data '{
"input": "",
"source": "",
"target": ""
}'
echo '{
"input": "",
"source": "",
"target": ""
}' | \
http POST {{baseUrl}}/ConvertWeight \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "source": "",\n "target": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertWeight
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"source": "",
"target": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertWeight")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Random number
{{baseUrl}}/RandomNumber
BODY json
{
"end": "",
"start": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/RandomNumber");
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 \"end\": \"\",\n \"start\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/RandomNumber" {:content-type :json
:form-params {:end ""
:start ""}})
require "http/client"
url = "{{baseUrl}}/RandomNumber"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"end\": \"\",\n \"start\": \"\"\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}}/RandomNumber"),
Content = new StringContent("{\n \"end\": \"\",\n \"start\": \"\"\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}}/RandomNumber");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"end\": \"\",\n \"start\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/RandomNumber"
payload := strings.NewReader("{\n \"end\": \"\",\n \"start\": \"\"\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/RandomNumber HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"end": "",
"start": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/RandomNumber")
.setHeader("content-type", "application/json")
.setBody("{\n \"end\": \"\",\n \"start\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/RandomNumber"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"end\": \"\",\n \"start\": \"\"\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 \"end\": \"\",\n \"start\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/RandomNumber")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/RandomNumber")
.header("content-type", "application/json")
.body("{\n \"end\": \"\",\n \"start\": \"\"\n}")
.asString();
const data = JSON.stringify({
end: '',
start: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/RandomNumber');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/RandomNumber',
headers: {'content-type': 'application/json'},
data: {end: '', start: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/RandomNumber';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"end":"","start":""}'
};
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}}/RandomNumber',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "end": "",\n "start": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"end\": \"\",\n \"start\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/RandomNumber")
.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/RandomNumber',
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({end: '', start: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/RandomNumber',
headers: {'content-type': 'application/json'},
body: {end: '', start: ''},
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}}/RandomNumber');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
end: '',
start: ''
});
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}}/RandomNumber',
headers: {'content-type': 'application/json'},
data: {end: '', start: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/RandomNumber';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"end":"","start":""}'
};
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 = @{ @"end": @"",
@"start": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/RandomNumber"]
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}}/RandomNumber" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"end\": \"\",\n \"start\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/RandomNumber",
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([
'end' => '',
'start' => ''
]),
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}}/RandomNumber', [
'body' => '{
"end": "",
"start": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/RandomNumber');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'end' => '',
'start' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'end' => '',
'start' => ''
]));
$request->setRequestUrl('{{baseUrl}}/RandomNumber');
$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}}/RandomNumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"end": "",
"start": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/RandomNumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"end": "",
"start": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"end\": \"\",\n \"start\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/RandomNumber", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/RandomNumber"
payload = {
"end": "",
"start": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/RandomNumber"
payload <- "{\n \"end\": \"\",\n \"start\": \"\"\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}}/RandomNumber")
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 \"end\": \"\",\n \"start\": \"\"\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/RandomNumber') do |req|
req.body = "{\n \"end\": \"\",\n \"start\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/RandomNumber";
let payload = json!({
"end": "",
"start": ""
});
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}}/RandomNumber \
--header 'content-type: application/json' \
--data '{
"end": "",
"start": ""
}'
echo '{
"end": "",
"start": ""
}' | \
http POST {{baseUrl}}/RandomNumber \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "end": "",\n "start": ""\n}' \
--output-document \
- {{baseUrl}}/RandomNumber
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"end": "",
"start": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/RandomNumber")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Math - Round number
{{baseUrl}}/RoundNumber
BODY json
{
"decimals": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/RoundNumber");
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 \"decimals\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/RoundNumber" {:content-type :json
:form-params {:decimals ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/RoundNumber"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/RoundNumber"),
Content = new StringContent("{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/RoundNumber");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"decimals\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/RoundNumber"
payload := strings.NewReader("{\n \"decimals\": \"\",\n \"input\": \"\"\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/RoundNumber HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"decimals": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/RoundNumber")
.setHeader("content-type", "application/json")
.setBody("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/RoundNumber"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"decimals\": \"\",\n \"input\": \"\"\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 \"decimals\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/RoundNumber")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/RoundNumber")
.header("content-type", "application/json")
.body("{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
decimals: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/RoundNumber');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/RoundNumber',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/RoundNumber';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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}}/RoundNumber',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "decimals": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"decimals\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/RoundNumber")
.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/RoundNumber',
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({decimals: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/RoundNumber',
headers: {'content-type': 'application/json'},
body: {decimals: '', input: ''},
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}}/RoundNumber');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
decimals: '',
input: ''
});
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}}/RoundNumber',
headers: {'content-type': 'application/json'},
data: {decimals: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/RoundNumber';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"decimals":"","input":""}'
};
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 = @{ @"decimals": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/RoundNumber"]
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}}/RoundNumber" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"decimals\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/RoundNumber",
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([
'decimals' => '',
'input' => ''
]),
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}}/RoundNumber', [
'body' => '{
"decimals": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/RoundNumber');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'decimals' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'decimals' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/RoundNumber');
$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}}/RoundNumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/RoundNumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"decimals": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/RoundNumber", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/RoundNumber"
payload = {
"decimals": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/RoundNumber"
payload <- "{\n \"decimals\": \"\",\n \"input\": \"\"\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}}/RoundNumber")
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 \"decimals\": \"\",\n \"input\": \"\"\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/RoundNumber') do |req|
req.body = "{\n \"decimals\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/RoundNumber";
let payload = json!({
"decimals": "",
"input": ""
});
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}}/RoundNumber \
--header 'content-type: application/json' \
--data '{
"decimals": "",
"input": ""
}'
echo '{
"decimals": "",
"input": ""
}' | \
http POST {{baseUrl}}/RoundNumber \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "decimals": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/RoundNumber
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"decimals": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/RoundNumber")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Compare strings
{{baseUrl}}/CompareStrings
BODY json
{
"compare": "",
"input": "",
"lower": "",
"trim": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CompareStrings");
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 \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CompareStrings" {:content-type :json
:form-params {:compare ""
:input ""
:lower ""
:trim ""}})
require "http/client"
url = "{{baseUrl}}/CompareStrings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\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}}/CompareStrings"),
Content = new StringContent("{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\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}}/CompareStrings");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CompareStrings"
payload := strings.NewReader("{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\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/CompareStrings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 63
{
"compare": "",
"input": "",
"lower": "",
"trim": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CompareStrings")
.setHeader("content-type", "application/json")
.setBody("{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CompareStrings"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\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 \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CompareStrings")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CompareStrings")
.header("content-type", "application/json")
.body("{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\n}")
.asString();
const data = JSON.stringify({
compare: '',
input: '',
lower: '',
trim: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CompareStrings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CompareStrings',
headers: {'content-type': 'application/json'},
data: {compare: '', input: '', lower: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CompareStrings';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"compare":"","input":"","lower":"","trim":""}'
};
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}}/CompareStrings',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "compare": "",\n "input": "",\n "lower": "",\n "trim": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CompareStrings")
.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/CompareStrings',
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({compare: '', input: '', lower: '', trim: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CompareStrings',
headers: {'content-type': 'application/json'},
body: {compare: '', input: '', lower: '', trim: ''},
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}}/CompareStrings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
compare: '',
input: '',
lower: '',
trim: ''
});
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}}/CompareStrings',
headers: {'content-type': 'application/json'},
data: {compare: '', input: '', lower: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CompareStrings';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"compare":"","input":"","lower":"","trim":""}'
};
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 = @{ @"compare": @"",
@"input": @"",
@"lower": @"",
@"trim": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CompareStrings"]
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}}/CompareStrings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CompareStrings",
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([
'compare' => '',
'input' => '',
'lower' => '',
'trim' => ''
]),
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}}/CompareStrings', [
'body' => '{
"compare": "",
"input": "",
"lower": "",
"trim": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CompareStrings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'compare' => '',
'input' => '',
'lower' => '',
'trim' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'compare' => '',
'input' => '',
'lower' => '',
'trim' => ''
]));
$request->setRequestUrl('{{baseUrl}}/CompareStrings');
$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}}/CompareStrings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"compare": "",
"input": "",
"lower": "",
"trim": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CompareStrings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"compare": "",
"input": "",
"lower": "",
"trim": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CompareStrings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CompareStrings"
payload = {
"compare": "",
"input": "",
"lower": "",
"trim": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CompareStrings"
payload <- "{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\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}}/CompareStrings")
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 \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\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/CompareStrings') do |req|
req.body = "{\n \"compare\": \"\",\n \"input\": \"\",\n \"lower\": \"\",\n \"trim\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CompareStrings";
let payload = json!({
"compare": "",
"input": "",
"lower": "",
"trim": ""
});
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}}/CompareStrings \
--header 'content-type: application/json' \
--data '{
"compare": "",
"input": "",
"lower": "",
"trim": ""
}'
echo '{
"compare": "",
"input": "",
"lower": "",
"trim": ""
}' | \
http POST {{baseUrl}}/CompareStrings \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "compare": "",\n "input": "",\n "lower": "",\n "trim": ""\n}' \
--output-document \
- {{baseUrl}}/CompareStrings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"compare": "",
"input": "",
"lower": "",
"trim": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CompareStrings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Contains string
{{baseUrl}}/ContainsString
BODY json
{
"find": "",
"input": "",
"lower": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ContainsString");
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 \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ContainsString" {:content-type :json
:form-params {:find ""
:input ""
:lower ""}})
require "http/client"
url = "{{baseUrl}}/ContainsString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\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}}/ContainsString"),
Content = new StringContent("{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\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}}/ContainsString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ContainsString"
payload := strings.NewReader("{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\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/ContainsString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"find": "",
"input": "",
"lower": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ContainsString")
.setHeader("content-type", "application/json")
.setBody("{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ContainsString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\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 \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ContainsString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ContainsString")
.header("content-type", "application/json")
.body("{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\n}")
.asString();
const data = JSON.stringify({
find: '',
input: '',
lower: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ContainsString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ContainsString',
headers: {'content-type': 'application/json'},
data: {find: '', input: '', lower: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ContainsString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"find":"","input":"","lower":""}'
};
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}}/ContainsString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "find": "",\n "input": "",\n "lower": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ContainsString")
.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/ContainsString',
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({find: '', input: '', lower: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ContainsString',
headers: {'content-type': 'application/json'},
body: {find: '', input: '', lower: ''},
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}}/ContainsString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
find: '',
input: '',
lower: ''
});
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}}/ContainsString',
headers: {'content-type': 'application/json'},
data: {find: '', input: '', lower: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ContainsString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"find":"","input":"","lower":""}'
};
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 = @{ @"find": @"",
@"input": @"",
@"lower": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ContainsString"]
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}}/ContainsString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ContainsString",
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([
'find' => '',
'input' => '',
'lower' => ''
]),
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}}/ContainsString', [
'body' => '{
"find": "",
"input": "",
"lower": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ContainsString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'find' => '',
'input' => '',
'lower' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'find' => '',
'input' => '',
'lower' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ContainsString');
$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}}/ContainsString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"find": "",
"input": "",
"lower": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ContainsString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"find": "",
"input": "",
"lower": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ContainsString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ContainsString"
payload = {
"find": "",
"input": "",
"lower": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ContainsString"
payload <- "{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\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}}/ContainsString")
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 \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\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/ContainsString') do |req|
req.body = "{\n \"find\": \"\",\n \"input\": \"\",\n \"lower\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ContainsString";
let payload = json!({
"find": "",
"input": "",
"lower": ""
});
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}}/ContainsString \
--header 'content-type: application/json' \
--data '{
"find": "",
"input": "",
"lower": ""
}'
echo '{
"find": "",
"input": "",
"lower": ""
}' | \
http POST {{baseUrl}}/ContainsString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "find": "",\n "input": "",\n "lower": ""\n}' \
--output-document \
- {{baseUrl}}/ContainsString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"find": "",
"input": "",
"lower": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ContainsString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Convert case
{{baseUrl}}/ConvertCase
BODY json
{
"alphacase": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ConvertCase");
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 \"alphacase\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ConvertCase" {:content-type :json
:form-params {:alphacase ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/ConvertCase"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"alphacase\": \"\",\n \"input\": \"\"\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}}/ConvertCase"),
Content = new StringContent("{\n \"alphacase\": \"\",\n \"input\": \"\"\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}}/ConvertCase");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"alphacase\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ConvertCase"
payload := strings.NewReader("{\n \"alphacase\": \"\",\n \"input\": \"\"\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/ConvertCase HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 36
{
"alphacase": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ConvertCase")
.setHeader("content-type", "application/json")
.setBody("{\n \"alphacase\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ConvertCase"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"alphacase\": \"\",\n \"input\": \"\"\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 \"alphacase\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ConvertCase")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ConvertCase")
.header("content-type", "application/json")
.body("{\n \"alphacase\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
alphacase: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ConvertCase');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertCase',
headers: {'content-type': 'application/json'},
data: {alphacase: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ConvertCase';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"alphacase":"","input":""}'
};
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}}/ConvertCase',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "alphacase": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"alphacase\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ConvertCase")
.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/ConvertCase',
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({alphacase: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ConvertCase',
headers: {'content-type': 'application/json'},
body: {alphacase: '', input: ''},
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}}/ConvertCase');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
alphacase: '',
input: ''
});
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}}/ConvertCase',
headers: {'content-type': 'application/json'},
data: {alphacase: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ConvertCase';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"alphacase":"","input":""}'
};
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 = @{ @"alphacase": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ConvertCase"]
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}}/ConvertCase" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"alphacase\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ConvertCase",
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([
'alphacase' => '',
'input' => ''
]),
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}}/ConvertCase', [
'body' => '{
"alphacase": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ConvertCase');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'alphacase' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'alphacase' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ConvertCase');
$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}}/ConvertCase' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"alphacase": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ConvertCase' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"alphacase": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"alphacase\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ConvertCase", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ConvertCase"
payload = {
"alphacase": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ConvertCase"
payload <- "{\n \"alphacase\": \"\",\n \"input\": \"\"\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}}/ConvertCase")
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 \"alphacase\": \"\",\n \"input\": \"\"\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/ConvertCase') do |req|
req.body = "{\n \"alphacase\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ConvertCase";
let payload = json!({
"alphacase": "",
"input": ""
});
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}}/ConvertCase \
--header 'content-type: application/json' \
--data '{
"alphacase": "",
"input": ""
}'
echo '{
"alphacase": "",
"input": ""
}' | \
http POST {{baseUrl}}/ConvertCase \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "alphacase": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/ConvertCase
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"alphacase": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ConvertCase")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Decode URL
{{baseUrl}}/URLDecode
BODY json
{
"source": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/URLDecode");
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 \"source\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/URLDecode" {:content-type :json
:form-params {:source ""}})
require "http/client"
url = "{{baseUrl}}/URLDecode"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"source\": \"\"\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}}/URLDecode"),
Content = new StringContent("{\n \"source\": \"\"\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}}/URLDecode");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"source\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/URLDecode"
payload := strings.NewReader("{\n \"source\": \"\"\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/URLDecode HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"source": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/URLDecode")
.setHeader("content-type", "application/json")
.setBody("{\n \"source\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/URLDecode"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"source\": \"\"\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 \"source\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/URLDecode")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/URLDecode")
.header("content-type", "application/json")
.body("{\n \"source\": \"\"\n}")
.asString();
const data = JSON.stringify({
source: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/URLDecode');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/URLDecode',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/URLDecode';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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}}/URLDecode',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "source": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"source\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/URLDecode")
.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/URLDecode',
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({source: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/URLDecode',
headers: {'content-type': 'application/json'},
body: {source: ''},
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}}/URLDecode');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
source: ''
});
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}}/URLDecode',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/URLDecode';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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 = @{ @"source": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/URLDecode"]
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}}/URLDecode" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"source\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/URLDecode",
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([
'source' => ''
]),
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}}/URLDecode', [
'body' => '{
"source": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/URLDecode');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'source' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'source' => ''
]));
$request->setRequestUrl('{{baseUrl}}/URLDecode');
$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}}/URLDecode' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/URLDecode' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"source\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/URLDecode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/URLDecode"
payload = { "source": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/URLDecode"
payload <- "{\n \"source\": \"\"\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}}/URLDecode")
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 \"source\": \"\"\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/URLDecode') do |req|
req.body = "{\n \"source\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/URLDecode";
let payload = json!({"source": ""});
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}}/URLDecode \
--header 'content-type: application/json' \
--data '{
"source": ""
}'
echo '{
"source": ""
}' | \
http POST {{baseUrl}}/URLDecode \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "source": ""\n}' \
--output-document \
- {{baseUrl}}/URLDecode
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["source": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/URLDecode")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Decode string
{{baseUrl}}/DecodeString
BODY json
{
"source": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DecodeString");
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 \"source\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DecodeString" {:content-type :json
:form-params {:source ""}})
require "http/client"
url = "{{baseUrl}}/DecodeString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"source\": \"\"\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}}/DecodeString"),
Content = new StringContent("{\n \"source\": \"\"\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}}/DecodeString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"source\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DecodeString"
payload := strings.NewReader("{\n \"source\": \"\"\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/DecodeString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"source": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DecodeString")
.setHeader("content-type", "application/json")
.setBody("{\n \"source\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DecodeString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"source\": \"\"\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 \"source\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DecodeString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DecodeString")
.header("content-type", "application/json")
.body("{\n \"source\": \"\"\n}")
.asString();
const data = JSON.stringify({
source: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DecodeString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DecodeString',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DecodeString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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}}/DecodeString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "source": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"source\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DecodeString")
.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/DecodeString',
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({source: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DecodeString',
headers: {'content-type': 'application/json'},
body: {source: ''},
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}}/DecodeString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
source: ''
});
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}}/DecodeString',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DecodeString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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 = @{ @"source": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DecodeString"]
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}}/DecodeString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"source\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DecodeString",
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([
'source' => ''
]),
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}}/DecodeString', [
'body' => '{
"source": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DecodeString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'source' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'source' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DecodeString');
$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}}/DecodeString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DecodeString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"source\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DecodeString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DecodeString"
payload = { "source": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DecodeString"
payload <- "{\n \"source\": \"\"\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}}/DecodeString")
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 \"source\": \"\"\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/DecodeString') do |req|
req.body = "{\n \"source\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DecodeString";
let payload = json!({"source": ""});
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}}/DecodeString \
--header 'content-type: application/json' \
--data '{
"source": ""
}'
echo '{
"source": ""
}' | \
http POST {{baseUrl}}/DecodeString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "source": ""\n}' \
--output-document \
- {{baseUrl}}/DecodeString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["source": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DecodeString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Encode URL
{{baseUrl}}/URLEncode
BODY json
{
"source": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/URLEncode");
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 \"source\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/URLEncode" {:content-type :json
:form-params {:source ""}})
require "http/client"
url = "{{baseUrl}}/URLEncode"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"source\": \"\"\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}}/URLEncode"),
Content = new StringContent("{\n \"source\": \"\"\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}}/URLEncode");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"source\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/URLEncode"
payload := strings.NewReader("{\n \"source\": \"\"\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/URLEncode HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"source": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/URLEncode")
.setHeader("content-type", "application/json")
.setBody("{\n \"source\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/URLEncode"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"source\": \"\"\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 \"source\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/URLEncode")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/URLEncode")
.header("content-type", "application/json")
.body("{\n \"source\": \"\"\n}")
.asString();
const data = JSON.stringify({
source: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/URLEncode');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/URLEncode',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/URLEncode';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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}}/URLEncode',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "source": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"source\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/URLEncode")
.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/URLEncode',
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({source: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/URLEncode',
headers: {'content-type': 'application/json'},
body: {source: ''},
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}}/URLEncode');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
source: ''
});
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}}/URLEncode',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/URLEncode';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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 = @{ @"source": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/URLEncode"]
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}}/URLEncode" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"source\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/URLEncode",
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([
'source' => ''
]),
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}}/URLEncode', [
'body' => '{
"source": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/URLEncode');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'source' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'source' => ''
]));
$request->setRequestUrl('{{baseUrl}}/URLEncode');
$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}}/URLEncode' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/URLEncode' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"source\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/URLEncode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/URLEncode"
payload = { "source": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/URLEncode"
payload <- "{\n \"source\": \"\"\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}}/URLEncode")
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 \"source\": \"\"\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/URLEncode') do |req|
req.body = "{\n \"source\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/URLEncode";
let payload = json!({"source": ""});
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}}/URLEncode \
--header 'content-type: application/json' \
--data '{
"source": ""
}'
echo '{
"source": ""
}' | \
http POST {{baseUrl}}/URLEncode \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "source": ""\n}' \
--output-document \
- {{baseUrl}}/URLEncode
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["source": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/URLEncode")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Encode string
{{baseUrl}}/EncodeString
BODY json
{
"source": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/EncodeString");
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 \"source\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/EncodeString" {:content-type :json
:form-params {:source ""}})
require "http/client"
url = "{{baseUrl}}/EncodeString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"source\": \"\"\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}}/EncodeString"),
Content = new StringContent("{\n \"source\": \"\"\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}}/EncodeString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"source\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/EncodeString"
payload := strings.NewReader("{\n \"source\": \"\"\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/EncodeString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"source": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/EncodeString")
.setHeader("content-type", "application/json")
.setBody("{\n \"source\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/EncodeString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"source\": \"\"\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 \"source\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/EncodeString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/EncodeString")
.header("content-type", "application/json")
.body("{\n \"source\": \"\"\n}")
.asString();
const data = JSON.stringify({
source: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/EncodeString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/EncodeString',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/EncodeString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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}}/EncodeString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "source": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"source\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/EncodeString")
.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/EncodeString',
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({source: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/EncodeString',
headers: {'content-type': 'application/json'},
body: {source: ''},
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}}/EncodeString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
source: ''
});
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}}/EncodeString',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/EncodeString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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 = @{ @"source": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/EncodeString"]
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}}/EncodeString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"source\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/EncodeString",
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([
'source' => ''
]),
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}}/EncodeString', [
'body' => '{
"source": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/EncodeString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'source' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'source' => ''
]));
$request->setRequestUrl('{{baseUrl}}/EncodeString');
$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}}/EncodeString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/EncodeString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"source\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/EncodeString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/EncodeString"
payload = { "source": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/EncodeString"
payload <- "{\n \"source\": \"\"\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}}/EncodeString")
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 \"source\": \"\"\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/EncodeString') do |req|
req.body = "{\n \"source\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/EncodeString";
let payload = json!({"source": ""});
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}}/EncodeString \
--header 'content-type: application/json' \
--data '{
"source": ""
}'
echo '{
"source": ""
}' | \
http POST {{baseUrl}}/EncodeString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "source": ""\n}' \
--output-document \
- {{baseUrl}}/EncodeString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["source": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/EncodeString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Generate GUID
{{baseUrl}}/GenerateGuid
BODY json
{
"uppercase": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/GenerateGuid");
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 \"uppercase\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/GenerateGuid" {:content-type :json
:form-params {:uppercase ""}})
require "http/client"
url = "{{baseUrl}}/GenerateGuid"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"uppercase\": \"\"\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}}/GenerateGuid"),
Content = new StringContent("{\n \"uppercase\": \"\"\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}}/GenerateGuid");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"uppercase\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/GenerateGuid"
payload := strings.NewReader("{\n \"uppercase\": \"\"\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/GenerateGuid HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"uppercase": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/GenerateGuid")
.setHeader("content-type", "application/json")
.setBody("{\n \"uppercase\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/GenerateGuid"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"uppercase\": \"\"\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 \"uppercase\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/GenerateGuid")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/GenerateGuid")
.header("content-type", "application/json")
.body("{\n \"uppercase\": \"\"\n}")
.asString();
const data = JSON.stringify({
uppercase: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/GenerateGuid');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/GenerateGuid',
headers: {'content-type': 'application/json'},
data: {uppercase: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/GenerateGuid';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"uppercase":""}'
};
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}}/GenerateGuid',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "uppercase": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"uppercase\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/GenerateGuid")
.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/GenerateGuid',
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({uppercase: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/GenerateGuid',
headers: {'content-type': 'application/json'},
body: {uppercase: ''},
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}}/GenerateGuid');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
uppercase: ''
});
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}}/GenerateGuid',
headers: {'content-type': 'application/json'},
data: {uppercase: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/GenerateGuid';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"uppercase":""}'
};
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 = @{ @"uppercase": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/GenerateGuid"]
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}}/GenerateGuid" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"uppercase\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/GenerateGuid",
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([
'uppercase' => ''
]),
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}}/GenerateGuid', [
'body' => '{
"uppercase": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/GenerateGuid');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'uppercase' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'uppercase' => ''
]));
$request->setRequestUrl('{{baseUrl}}/GenerateGuid');
$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}}/GenerateGuid' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"uppercase": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/GenerateGuid' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"uppercase": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"uppercase\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/GenerateGuid", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/GenerateGuid"
payload = { "uppercase": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/GenerateGuid"
payload <- "{\n \"uppercase\": \"\"\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}}/GenerateGuid")
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 \"uppercase\": \"\"\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/GenerateGuid') do |req|
req.body = "{\n \"uppercase\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/GenerateGuid";
let payload = json!({"uppercase": ""});
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}}/GenerateGuid \
--header 'content-type: application/json' \
--data '{
"uppercase": ""
}'
echo '{
"uppercase": ""
}' | \
http POST {{baseUrl}}/GenerateGuid \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "uppercase": ""\n}' \
--output-document \
- {{baseUrl}}/GenerateGuid
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["uppercase": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/GenerateGuid")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Generate hash
{{baseUrl}}/GenerateHash
BODY json
{
"algorithm": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/GenerateHash");
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 \"algorithm\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/GenerateHash" {:content-type :json
:form-params {:algorithm ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/GenerateHash"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"algorithm\": \"\",\n \"input\": \"\"\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}}/GenerateHash"),
Content = new StringContent("{\n \"algorithm\": \"\",\n \"input\": \"\"\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}}/GenerateHash");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"algorithm\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/GenerateHash"
payload := strings.NewReader("{\n \"algorithm\": \"\",\n \"input\": \"\"\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/GenerateHash HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 36
{
"algorithm": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/GenerateHash")
.setHeader("content-type", "application/json")
.setBody("{\n \"algorithm\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/GenerateHash"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"algorithm\": \"\",\n \"input\": \"\"\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 \"algorithm\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/GenerateHash")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/GenerateHash")
.header("content-type", "application/json")
.body("{\n \"algorithm\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
algorithm: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/GenerateHash');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/GenerateHash',
headers: {'content-type': 'application/json'},
data: {algorithm: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/GenerateHash';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":"","input":""}'
};
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}}/GenerateHash',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "algorithm": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"algorithm\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/GenerateHash")
.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/GenerateHash',
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({algorithm: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/GenerateHash',
headers: {'content-type': 'application/json'},
body: {algorithm: '', input: ''},
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}}/GenerateHash');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
algorithm: '',
input: ''
});
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}}/GenerateHash',
headers: {'content-type': 'application/json'},
data: {algorithm: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/GenerateHash';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":"","input":""}'
};
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 = @{ @"algorithm": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/GenerateHash"]
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}}/GenerateHash" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"algorithm\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/GenerateHash",
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([
'algorithm' => '',
'input' => ''
]),
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}}/GenerateHash', [
'body' => '{
"algorithm": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/GenerateHash');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'algorithm' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'algorithm' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/GenerateHash');
$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}}/GenerateHash' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/GenerateHash' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"algorithm\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/GenerateHash", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/GenerateHash"
payload = {
"algorithm": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/GenerateHash"
payload <- "{\n \"algorithm\": \"\",\n \"input\": \"\"\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}}/GenerateHash")
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 \"algorithm\": \"\",\n \"input\": \"\"\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/GenerateHash') do |req|
req.body = "{\n \"algorithm\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/GenerateHash";
let payload = json!({
"algorithm": "",
"input": ""
});
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}}/GenerateHash \
--header 'content-type: application/json' \
--data '{
"algorithm": "",
"input": ""
}'
echo '{
"algorithm": "",
"input": ""
}' | \
http POST {{baseUrl}}/GenerateHash \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "algorithm": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/GenerateHash
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"algorithm": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/GenerateHash")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Join strings
{{baseUrl}}/JoinStrings
BODY json
{
"input": [],
"lower": "",
"separator": "",
"trim": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/JoinStrings");
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 \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/JoinStrings" {:content-type :json
:form-params {:input []
:lower ""
:separator ""
:trim ""}})
require "http/client"
url = "{{baseUrl}}/JoinStrings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\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}}/JoinStrings"),
Content = new StringContent("{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\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}}/JoinStrings");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/JoinStrings"
payload := strings.NewReader("{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\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/JoinStrings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"input": [],
"lower": "",
"separator": "",
"trim": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/JoinStrings")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/JoinStrings"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\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 \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/JoinStrings")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/JoinStrings")
.header("content-type", "application/json")
.body("{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: [],
lower: '',
separator: '',
trim: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/JoinStrings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/JoinStrings',
headers: {'content-type': 'application/json'},
data: {input: [], lower: '', separator: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/JoinStrings';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"lower":"","separator":"","trim":""}'
};
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}}/JoinStrings',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": [],\n "lower": "",\n "separator": "",\n "trim": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/JoinStrings")
.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/JoinStrings',
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({input: [], lower: '', separator: '', trim: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/JoinStrings',
headers: {'content-type': 'application/json'},
body: {input: [], lower: '', separator: '', trim: ''},
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}}/JoinStrings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: [],
lower: '',
separator: '',
trim: ''
});
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}}/JoinStrings',
headers: {'content-type': 'application/json'},
data: {input: [], lower: '', separator: '', trim: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/JoinStrings';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":[],"lower":"","separator":"","trim":""}'
};
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 = @{ @"input": @[ ],
@"lower": @"",
@"separator": @"",
@"trim": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/JoinStrings"]
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}}/JoinStrings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/JoinStrings",
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([
'input' => [
],
'lower' => '',
'separator' => '',
'trim' => ''
]),
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}}/JoinStrings', [
'body' => '{
"input": [],
"lower": "",
"separator": "",
"trim": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/JoinStrings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => [
],
'lower' => '',
'separator' => '',
'trim' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => [
],
'lower' => '',
'separator' => '',
'trim' => ''
]));
$request->setRequestUrl('{{baseUrl}}/JoinStrings');
$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}}/JoinStrings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"lower": "",
"separator": "",
"trim": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/JoinStrings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": [],
"lower": "",
"separator": "",
"trim": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/JoinStrings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/JoinStrings"
payload = {
"input": [],
"lower": "",
"separator": "",
"trim": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/JoinStrings"
payload <- "{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\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}}/JoinStrings")
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 \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\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/JoinStrings') do |req|
req.body = "{\n \"input\": [],\n \"lower\": \"\",\n \"separator\": \"\",\n \"trim\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/JoinStrings";
let payload = json!({
"input": (),
"lower": "",
"separator": "",
"trim": ""
});
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}}/JoinStrings \
--header 'content-type: application/json' \
--data '{
"input": [],
"lower": "",
"separator": "",
"trim": ""
}'
echo '{
"input": [],
"lower": "",
"separator": "",
"trim": ""
}' | \
http POST {{baseUrl}}/JoinStrings \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": [],\n "lower": "",\n "separator": "",\n "trim": ""\n}' \
--output-document \
- {{baseUrl}}/JoinStrings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": [],
"lower": "",
"separator": "",
"trim": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/JoinStrings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Redact string
{{baseUrl}}/RedactString
BODY json
{
"regex": "",
"source": "",
"value": "",
"values": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/RedactString");
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 \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/RedactString" {:content-type :json
:form-params {:regex ""
:source ""
:value ""
:values []}})
require "http/client"
url = "{{baseUrl}}/RedactString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\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}}/RedactString"),
Content = new StringContent("{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\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}}/RedactString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/RedactString"
payload := strings.NewReader("{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\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/RedactString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 64
{
"regex": "",
"source": "",
"value": "",
"values": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/RedactString")
.setHeader("content-type", "application/json")
.setBody("{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/RedactString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\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 \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/RedactString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/RedactString")
.header("content-type", "application/json")
.body("{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\n}")
.asString();
const data = JSON.stringify({
regex: '',
source: '',
value: '',
values: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/RedactString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/RedactString',
headers: {'content-type': 'application/json'},
data: {regex: '', source: '', value: '', values: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/RedactString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"regex":"","source":"","value":"","values":[]}'
};
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}}/RedactString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "regex": "",\n "source": "",\n "value": "",\n "values": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/RedactString")
.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/RedactString',
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({regex: '', source: '', value: '', values: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/RedactString',
headers: {'content-type': 'application/json'},
body: {regex: '', source: '', value: '', values: []},
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}}/RedactString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
regex: '',
source: '',
value: '',
values: []
});
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}}/RedactString',
headers: {'content-type': 'application/json'},
data: {regex: '', source: '', value: '', values: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/RedactString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"regex":"","source":"","value":"","values":[]}'
};
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 = @{ @"regex": @"",
@"source": @"",
@"value": @"",
@"values": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/RedactString"]
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}}/RedactString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/RedactString",
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([
'regex' => '',
'source' => '',
'value' => '',
'values' => [
]
]),
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}}/RedactString', [
'body' => '{
"regex": "",
"source": "",
"value": "",
"values": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/RedactString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'regex' => '',
'source' => '',
'value' => '',
'values' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'regex' => '',
'source' => '',
'value' => '',
'values' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/RedactString');
$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}}/RedactString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"regex": "",
"source": "",
"value": "",
"values": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/RedactString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"regex": "",
"source": "",
"value": "",
"values": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/RedactString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/RedactString"
payload = {
"regex": "",
"source": "",
"value": "",
"values": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/RedactString"
payload <- "{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\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}}/RedactString")
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 \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\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/RedactString') do |req|
req.body = "{\n \"regex\": \"\",\n \"source\": \"\",\n \"value\": \"\",\n \"values\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/RedactString";
let payload = json!({
"regex": "",
"source": "",
"value": "",
"values": ()
});
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}}/RedactString \
--header 'content-type: application/json' \
--data '{
"regex": "",
"source": "",
"value": "",
"values": []
}'
echo '{
"regex": "",
"source": "",
"value": "",
"values": []
}' | \
http POST {{baseUrl}}/RedactString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "regex": "",\n "source": "",\n "value": "",\n "values": []\n}' \
--output-document \
- {{baseUrl}}/RedactString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"regex": "",
"source": "",
"value": "",
"values": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/RedactString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Replace string
{{baseUrl}}/ReplaceString
BODY json
{
"replacement": "",
"source": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ReplaceString");
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 \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ReplaceString" {:content-type :json
:form-params {:replacement ""
:source ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/ReplaceString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\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}}/ReplaceString"),
Content = new StringContent("{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\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}}/ReplaceString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ReplaceString"
payload := strings.NewReader("{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\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/ReplaceString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 54
{
"replacement": "",
"source": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ReplaceString")
.setHeader("content-type", "application/json")
.setBody("{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ReplaceString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\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 \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ReplaceString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ReplaceString")
.header("content-type", "application/json")
.body("{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
replacement: '',
source: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ReplaceString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ReplaceString',
headers: {'content-type': 'application/json'},
data: {replacement: '', source: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ReplaceString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"replacement":"","source":"","value":""}'
};
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}}/ReplaceString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "replacement": "",\n "source": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ReplaceString")
.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/ReplaceString',
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({replacement: '', source: '', value: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ReplaceString',
headers: {'content-type': 'application/json'},
body: {replacement: '', source: '', value: ''},
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}}/ReplaceString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
replacement: '',
source: '',
value: ''
});
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}}/ReplaceString',
headers: {'content-type': 'application/json'},
data: {replacement: '', source: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ReplaceString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"replacement":"","source":"","value":""}'
};
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 = @{ @"replacement": @"",
@"source": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ReplaceString"]
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}}/ReplaceString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ReplaceString",
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([
'replacement' => '',
'source' => '',
'value' => ''
]),
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}}/ReplaceString', [
'body' => '{
"replacement": "",
"source": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ReplaceString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'replacement' => '',
'source' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'replacement' => '',
'source' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ReplaceString');
$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}}/ReplaceString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"replacement": "",
"source": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ReplaceString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"replacement": "",
"source": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ReplaceString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ReplaceString"
payload = {
"replacement": "",
"source": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ReplaceString"
payload <- "{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\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}}/ReplaceString")
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 \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\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/ReplaceString') do |req|
req.body = "{\n \"replacement\": \"\",\n \"source\": \"\",\n \"value\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ReplaceString";
let payload = json!({
"replacement": "",
"source": "",
"value": ""
});
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}}/ReplaceString \
--header 'content-type: application/json' \
--data '{
"replacement": "",
"source": "",
"value": ""
}'
echo '{
"replacement": "",
"source": "",
"value": ""
}' | \
http POST {{baseUrl}}/ReplaceString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "replacement": "",\n "source": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/ReplaceString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"replacement": "",
"source": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ReplaceString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Shorten hyperlink
{{baseUrl}}/ShortenLink
BODY json
{
"source": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ShortenLink");
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 \"source\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ShortenLink" {:content-type :json
:form-params {:source ""}})
require "http/client"
url = "{{baseUrl}}/ShortenLink"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"source\": \"\"\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}}/ShortenLink"),
Content = new StringContent("{\n \"source\": \"\"\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}}/ShortenLink");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"source\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ShortenLink"
payload := strings.NewReader("{\n \"source\": \"\"\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/ShortenLink HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"source": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ShortenLink")
.setHeader("content-type", "application/json")
.setBody("{\n \"source\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ShortenLink"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"source\": \"\"\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 \"source\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ShortenLink")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ShortenLink")
.header("content-type", "application/json")
.body("{\n \"source\": \"\"\n}")
.asString();
const data = JSON.stringify({
source: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ShortenLink');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ShortenLink',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ShortenLink';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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}}/ShortenLink',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "source": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"source\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ShortenLink")
.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/ShortenLink',
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({source: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ShortenLink',
headers: {'content-type': 'application/json'},
body: {source: ''},
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}}/ShortenLink');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
source: ''
});
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}}/ShortenLink',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ShortenLink';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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 = @{ @"source": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ShortenLink"]
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}}/ShortenLink" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"source\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ShortenLink",
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([
'source' => ''
]),
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}}/ShortenLink', [
'body' => '{
"source": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ShortenLink');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'source' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'source' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ShortenLink');
$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}}/ShortenLink' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ShortenLink' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"source\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ShortenLink", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ShortenLink"
payload = { "source": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ShortenLink"
payload <- "{\n \"source\": \"\"\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}}/ShortenLink")
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 \"source\": \"\"\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/ShortenLink') do |req|
req.body = "{\n \"source\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ShortenLink";
let payload = json!({"source": ""});
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}}/ShortenLink \
--header 'content-type: application/json' \
--data '{
"source": ""
}'
echo '{
"source": ""
}' | \
http POST {{baseUrl}}/ShortenLink \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "source": ""\n}' \
--output-document \
- {{baseUrl}}/ShortenLink
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["source": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ShortenLink")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Speech to Text
{{baseUrl}}/SpeechToText
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/SpeechToText");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/SpeechToText")
require "http/client"
url = "{{baseUrl}}/SpeechToText"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/SpeechToText"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/SpeechToText");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/SpeechToText"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/SpeechToText HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/SpeechToText")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/SpeechToText"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/SpeechToText")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/SpeechToText")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/SpeechToText');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/SpeechToText'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/SpeechToText';
const options = {method: 'POST'};
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}}/SpeechToText',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/SpeechToText")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/SpeechToText',
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: 'POST', url: '{{baseUrl}}/SpeechToText'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/SpeechToText');
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}}/SpeechToText'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/SpeechToText';
const options = {method: 'POST'};
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}}/SpeechToText"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/SpeechToText" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/SpeechToText",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/SpeechToText');
echo $response->getBody();
setUrl('{{baseUrl}}/SpeechToText');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/SpeechToText');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/SpeechToText' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/SpeechToText' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/SpeechToText", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/SpeechToText"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/SpeechToText"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/SpeechToText")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/SpeechToText') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/SpeechToText";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/SpeechToText
http POST {{baseUrl}}/SpeechToText
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/SpeechToText
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/SpeechToText")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Split string
{{baseUrl}}/SplitString
BODY json
{
"characters": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/SplitString");
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 \"characters\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/SplitString" {:content-type :json
:form-params {:characters ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/SplitString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"characters\": \"\",\n \"input\": \"\"\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}}/SplitString"),
Content = new StringContent("{\n \"characters\": \"\",\n \"input\": \"\"\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}}/SplitString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"characters\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/SplitString"
payload := strings.NewReader("{\n \"characters\": \"\",\n \"input\": \"\"\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/SplitString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"characters": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/SplitString")
.setHeader("content-type", "application/json")
.setBody("{\n \"characters\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/SplitString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"characters\": \"\",\n \"input\": \"\"\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 \"characters\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/SplitString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/SplitString")
.header("content-type", "application/json")
.body("{\n \"characters\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
characters: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/SplitString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/SplitString',
headers: {'content-type': 'application/json'},
data: {characters: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/SplitString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"characters":"","input":""}'
};
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}}/SplitString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "characters": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"characters\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/SplitString")
.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/SplitString',
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({characters: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/SplitString',
headers: {'content-type': 'application/json'},
body: {characters: '', input: ''},
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}}/SplitString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
characters: '',
input: ''
});
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}}/SplitString',
headers: {'content-type': 'application/json'},
data: {characters: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/SplitString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"characters":"","input":""}'
};
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 = @{ @"characters": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/SplitString"]
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}}/SplitString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"characters\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/SplitString",
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([
'characters' => '',
'input' => ''
]),
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}}/SplitString', [
'body' => '{
"characters": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/SplitString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'characters' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'characters' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/SplitString');
$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}}/SplitString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"characters": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/SplitString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"characters": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"characters\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/SplitString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/SplitString"
payload = {
"characters": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/SplitString"
payload <- "{\n \"characters\": \"\",\n \"input\": \"\"\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}}/SplitString")
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 \"characters\": \"\",\n \"input\": \"\"\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/SplitString') do |req|
req.body = "{\n \"characters\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/SplitString";
let payload = json!({
"characters": "",
"input": ""
});
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}}/SplitString \
--header 'content-type: application/json' \
--data '{
"characters": "",
"input": ""
}'
echo '{
"characters": "",
"input": ""
}' | \
http POST {{baseUrl}}/SplitString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "characters": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/SplitString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"characters": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/SplitString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": [
"string"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - String to File
{{baseUrl}}/StringToFile
BODY json
{
"extension": "",
"filename": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/StringToFile");
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 \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/StringToFile" {:content-type :json
:form-params {:extension ""
:filename ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/StringToFile"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\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}}/StringToFile"),
Content = new StringContent("{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\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}}/StringToFile");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/StringToFile"
payload := strings.NewReader("{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\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/StringToFile HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 54
{
"extension": "",
"filename": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/StringToFile")
.setHeader("content-type", "application/json")
.setBody("{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/StringToFile"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\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 \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/StringToFile")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/StringToFile")
.header("content-type", "application/json")
.body("{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
extension: '',
filename: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/StringToFile');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/StringToFile',
headers: {'content-type': 'application/json'},
data: {extension: '', filename: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/StringToFile';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"extension":"","filename":"","input":""}'
};
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}}/StringToFile',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "extension": "",\n "filename": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/StringToFile")
.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/StringToFile',
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({extension: '', filename: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/StringToFile',
headers: {'content-type': 'application/json'},
body: {extension: '', filename: '', input: ''},
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}}/StringToFile');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
extension: '',
filename: '',
input: ''
});
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}}/StringToFile',
headers: {'content-type': 'application/json'},
data: {extension: '', filename: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/StringToFile';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"extension":"","filename":"","input":""}'
};
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 = @{ @"extension": @"",
@"filename": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/StringToFile"]
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}}/StringToFile" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/StringToFile",
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([
'extension' => '',
'filename' => '',
'input' => ''
]),
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}}/StringToFile', [
'body' => '{
"extension": "",
"filename": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/StringToFile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'extension' => '',
'filename' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'extension' => '',
'filename' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/StringToFile');
$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}}/StringToFile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"extension": "",
"filename": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/StringToFile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"extension": "",
"filename": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/StringToFile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/StringToFile"
payload = {
"extension": "",
"filename": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/StringToFile"
payload <- "{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\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}}/StringToFile")
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 \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\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/StringToFile') do |req|
req.body = "{\n \"extension\": \"\",\n \"filename\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/StringToFile";
let payload = json!({
"extension": "",
"filename": "",
"input": ""
});
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}}/StringToFile \
--header 'content-type: application/json' \
--data '{
"extension": "",
"filename": "",
"input": ""
}'
echo '{
"extension": "",
"filename": "",
"input": ""
}' | \
http POST {{baseUrl}}/StringToFile \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "extension": "",\n "filename": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/StringToFile
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"extension": "",
"filename": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/StringToFile")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/xml
RESPONSE BODY xml
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
text/css
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
text/csv
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
text/html
RESPONSE BODY html
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
text/javascript
RESPONSE BODY text
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
text/plain
RESPONSE BODY text
{
"result": "string"
}
POST
Text - Text to Speech
{{baseUrl}}/TextToSpeech
BODY json
{
"text": "",
"type": "",
"voice": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/TextToSpeech");
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 \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/TextToSpeech" {:content-type :json
:form-params {:text ""
:type ""
:voice ""}})
require "http/client"
url = "{{baseUrl}}/TextToSpeech"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\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}}/TextToSpeech"),
Content = new StringContent("{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\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}}/TextToSpeech");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/TextToSpeech"
payload := strings.NewReader("{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\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/TextToSpeech HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 45
{
"text": "",
"type": "",
"voice": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/TextToSpeech")
.setHeader("content-type", "application/json")
.setBody("{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/TextToSpeech"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\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 \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/TextToSpeech")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/TextToSpeech")
.header("content-type", "application/json")
.body("{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\n}")
.asString();
const data = JSON.stringify({
text: '',
type: '',
voice: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/TextToSpeech');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/TextToSpeech',
headers: {'content-type': 'application/json'},
data: {text: '', type: '', voice: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/TextToSpeech';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"text":"","type":"","voice":""}'
};
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}}/TextToSpeech',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "text": "",\n "type": "",\n "voice": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/TextToSpeech")
.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/TextToSpeech',
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({text: '', type: '', voice: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/TextToSpeech',
headers: {'content-type': 'application/json'},
body: {text: '', type: '', voice: ''},
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}}/TextToSpeech');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
text: '',
type: '',
voice: ''
});
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}}/TextToSpeech',
headers: {'content-type': 'application/json'},
data: {text: '', type: '', voice: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/TextToSpeech';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"text":"","type":"","voice":""}'
};
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 = @{ @"text": @"",
@"type": @"",
@"voice": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/TextToSpeech"]
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}}/TextToSpeech" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/TextToSpeech",
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([
'text' => '',
'type' => '',
'voice' => ''
]),
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}}/TextToSpeech', [
'body' => '{
"text": "",
"type": "",
"voice": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/TextToSpeech');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'text' => '',
'type' => '',
'voice' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'text' => '',
'type' => '',
'voice' => ''
]));
$request->setRequestUrl('{{baseUrl}}/TextToSpeech');
$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}}/TextToSpeech' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"text": "",
"type": "",
"voice": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/TextToSpeech' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"text": "",
"type": "",
"voice": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/TextToSpeech", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/TextToSpeech"
payload = {
"text": "",
"type": "",
"voice": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/TextToSpeech"
payload <- "{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\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}}/TextToSpeech")
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 \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\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/TextToSpeech') do |req|
req.body = "{\n \"text\": \"\",\n \"type\": \"\",\n \"voice\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/TextToSpeech";
let payload = json!({
"text": "",
"type": "",
"voice": ""
});
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}}/TextToSpeech \
--header 'content-type: application/json' \
--data '{
"text": "",
"type": "",
"voice": ""
}'
echo '{
"text": "",
"type": "",
"voice": ""
}' | \
http POST {{baseUrl}}/TextToSpeech \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "text": "",\n "type": "",\n "voice": ""\n}' \
--output-document \
- {{baseUrl}}/TextToSpeech
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"text": "",
"type": "",
"voice": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/TextToSpeech")! 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
audio/mp3
RESPONSE BODY text
{
"result": "string"
}
POST
Text - Translate string
{{baseUrl}}/TranslateString
BODY json
{
"input": "",
"language": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/TranslateString");
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 \"input\": \"\",\n \"language\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/TranslateString" {:content-type :json
:form-params {:input ""
:language ""}})
require "http/client"
url = "{{baseUrl}}/TranslateString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"input\": \"\",\n \"language\": \"\"\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}}/TranslateString"),
Content = new StringContent("{\n \"input\": \"\",\n \"language\": \"\"\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}}/TranslateString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"input\": \"\",\n \"language\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/TranslateString"
payload := strings.NewReader("{\n \"input\": \"\",\n \"language\": \"\"\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/TranslateString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"input": "",
"language": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/TranslateString")
.setHeader("content-type", "application/json")
.setBody("{\n \"input\": \"\",\n \"language\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/TranslateString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"input\": \"\",\n \"language\": \"\"\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 \"input\": \"\",\n \"language\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/TranslateString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/TranslateString")
.header("content-type", "application/json")
.body("{\n \"input\": \"\",\n \"language\": \"\"\n}")
.asString();
const data = JSON.stringify({
input: '',
language: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/TranslateString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/TranslateString',
headers: {'content-type': 'application/json'},
data: {input: '', language: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/TranslateString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","language":""}'
};
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}}/TranslateString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "input": "",\n "language": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"input\": \"\",\n \"language\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/TranslateString")
.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/TranslateString',
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({input: '', language: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/TranslateString',
headers: {'content-type': 'application/json'},
body: {input: '', language: ''},
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}}/TranslateString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
input: '',
language: ''
});
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}}/TranslateString',
headers: {'content-type': 'application/json'},
data: {input: '', language: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/TranslateString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"input":"","language":""}'
};
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 = @{ @"input": @"",
@"language": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/TranslateString"]
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}}/TranslateString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"input\": \"\",\n \"language\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/TranslateString",
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([
'input' => '',
'language' => ''
]),
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}}/TranslateString', [
'body' => '{
"input": "",
"language": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/TranslateString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'input' => '',
'language' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'input' => '',
'language' => ''
]));
$request->setRequestUrl('{{baseUrl}}/TranslateString');
$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}}/TranslateString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"language": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/TranslateString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"input": "",
"language": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"input\": \"\",\n \"language\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/TranslateString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/TranslateString"
payload = {
"input": "",
"language": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/TranslateString"
payload <- "{\n \"input\": \"\",\n \"language\": \"\"\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}}/TranslateString")
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 \"input\": \"\",\n \"language\": \"\"\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/TranslateString') do |req|
req.body = "{\n \"input\": \"\",\n \"language\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/TranslateString";
let payload = json!({
"input": "",
"language": ""
});
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}}/TranslateString \
--header 'content-type: application/json' \
--data '{
"input": "",
"language": ""
}'
echo '{
"input": "",
"language": ""
}' | \
http POST {{baseUrl}}/TranslateString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "input": "",\n "language": ""\n}' \
--output-document \
- {{baseUrl}}/TranslateString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"input": "",
"language": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/TranslateString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Trim string
{{baseUrl}}/TrimString
BODY json
{
"source": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/TrimString");
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 \"source\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/TrimString" {:content-type :json
:form-params {:source ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/TrimString"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"source\": \"\",\n \"type\": \"\"\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}}/TrimString"),
Content = new StringContent("{\n \"source\": \"\",\n \"type\": \"\"\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}}/TrimString");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"source\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/TrimString"
payload := strings.NewReader("{\n \"source\": \"\",\n \"type\": \"\"\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/TrimString HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 32
{
"source": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/TrimString")
.setHeader("content-type", "application/json")
.setBody("{\n \"source\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/TrimString"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"source\": \"\",\n \"type\": \"\"\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 \"source\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/TrimString")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/TrimString")
.header("content-type", "application/json")
.body("{\n \"source\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
source: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/TrimString');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/TrimString',
headers: {'content-type': 'application/json'},
data: {source: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/TrimString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":"","type":""}'
};
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}}/TrimString',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "source": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"source\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/TrimString")
.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/TrimString',
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({source: '', type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/TrimString',
headers: {'content-type': 'application/json'},
body: {source: '', type: ''},
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}}/TrimString');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
source: '',
type: ''
});
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}}/TrimString',
headers: {'content-type': 'application/json'},
data: {source: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/TrimString';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":"","type":""}'
};
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 = @{ @"source": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/TrimString"]
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}}/TrimString" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"source\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/TrimString",
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([
'source' => '',
'type' => ''
]),
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}}/TrimString', [
'body' => '{
"source": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/TrimString');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'source' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'source' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/TrimString');
$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}}/TrimString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/TrimString' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"source\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/TrimString", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/TrimString"
payload = {
"source": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/TrimString"
payload <- "{\n \"source\": \"\",\n \"type\": \"\"\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}}/TrimString")
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 \"source\": \"\",\n \"type\": \"\"\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/TrimString') do |req|
req.body = "{\n \"source\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/TrimString";
let payload = json!({
"source": "",
"type": ""
});
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}}/TrimString \
--header 'content-type: application/json' \
--data '{
"source": "",
"type": ""
}'
echo '{
"source": "",
"type": ""
}' | \
http POST {{baseUrl}}/TrimString \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "source": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/TrimString
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"source": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/TrimString")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Validate email
{{baseUrl}}/ValidateEmail
BODY json
{
"source": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ValidateEmail");
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 \"source\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ValidateEmail" {:content-type :json
:form-params {:source ""}})
require "http/client"
url = "{{baseUrl}}/ValidateEmail"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"source\": \"\"\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}}/ValidateEmail"),
Content = new StringContent("{\n \"source\": \"\"\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}}/ValidateEmail");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"source\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ValidateEmail"
payload := strings.NewReader("{\n \"source\": \"\"\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/ValidateEmail HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"source": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ValidateEmail")
.setHeader("content-type", "application/json")
.setBody("{\n \"source\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ValidateEmail"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"source\": \"\"\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 \"source\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ValidateEmail")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ValidateEmail")
.header("content-type", "application/json")
.body("{\n \"source\": \"\"\n}")
.asString();
const data = JSON.stringify({
source: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ValidateEmail');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ValidateEmail',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ValidateEmail';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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}}/ValidateEmail',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "source": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"source\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ValidateEmail")
.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/ValidateEmail',
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({source: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ValidateEmail',
headers: {'content-type': 'application/json'},
body: {source: ''},
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}}/ValidateEmail');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
source: ''
});
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}}/ValidateEmail',
headers: {'content-type': 'application/json'},
data: {source: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ValidateEmail';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"source":""}'
};
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 = @{ @"source": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ValidateEmail"]
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}}/ValidateEmail" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"source\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ValidateEmail",
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([
'source' => ''
]),
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}}/ValidateEmail', [
'body' => '{
"source": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ValidateEmail');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'source' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'source' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ValidateEmail');
$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}}/ValidateEmail' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ValidateEmail' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"source": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"source\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ValidateEmail", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ValidateEmail"
payload = { "source": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ValidateEmail"
payload <- "{\n \"source\": \"\"\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}}/ValidateEmail")
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 \"source\": \"\"\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/ValidateEmail') do |req|
req.body = "{\n \"source\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ValidateEmail";
let payload = json!({"source": ""});
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}}/ValidateEmail \
--header 'content-type: application/json' \
--data '{
"source": ""
}'
echo '{
"source": ""
}' | \
http POST {{baseUrl}}/ValidateEmail \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "source": ""\n}' \
--output-document \
- {{baseUrl}}/ValidateEmail
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["source": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ValidateEmail")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}
POST
Text - Verify hash
{{baseUrl}}/VerifyHash
BODY json
{
"algorithm": "",
"hash": "",
"input": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/VerifyHash");
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 \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/VerifyHash" {:content-type :json
:form-params {:algorithm ""
:hash ""
:input ""}})
require "http/client"
url = "{{baseUrl}}/VerifyHash"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\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}}/VerifyHash"),
Content = new StringContent("{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\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}}/VerifyHash");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/VerifyHash"
payload := strings.NewReader("{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\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/VerifyHash HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"algorithm": "",
"hash": "",
"input": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/VerifyHash")
.setHeader("content-type", "application/json")
.setBody("{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/VerifyHash"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\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 \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/VerifyHash")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/VerifyHash")
.header("content-type", "application/json")
.body("{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\n}")
.asString();
const data = JSON.stringify({
algorithm: '',
hash: '',
input: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/VerifyHash');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/VerifyHash',
headers: {'content-type': 'application/json'},
data: {algorithm: '', hash: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/VerifyHash';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":"","hash":"","input":""}'
};
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}}/VerifyHash',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "algorithm": "",\n "hash": "",\n "input": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/VerifyHash")
.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/VerifyHash',
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({algorithm: '', hash: '', input: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/VerifyHash',
headers: {'content-type': 'application/json'},
body: {algorithm: '', hash: '', input: ''},
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}}/VerifyHash');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
algorithm: '',
hash: '',
input: ''
});
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}}/VerifyHash',
headers: {'content-type': 'application/json'},
data: {algorithm: '', hash: '', input: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/VerifyHash';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":"","hash":"","input":""}'
};
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 = @{ @"algorithm": @"",
@"hash": @"",
@"input": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/VerifyHash"]
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}}/VerifyHash" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/VerifyHash",
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([
'algorithm' => '',
'hash' => '',
'input' => ''
]),
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}}/VerifyHash', [
'body' => '{
"algorithm": "",
"hash": "",
"input": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/VerifyHash');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'algorithm' => '',
'hash' => '',
'input' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'algorithm' => '',
'hash' => '',
'input' => ''
]));
$request->setRequestUrl('{{baseUrl}}/VerifyHash');
$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}}/VerifyHash' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": "",
"hash": "",
"input": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/VerifyHash' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": "",
"hash": "",
"input": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/VerifyHash", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/VerifyHash"
payload = {
"algorithm": "",
"hash": "",
"input": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/VerifyHash"
payload <- "{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\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}}/VerifyHash")
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 \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\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/VerifyHash') do |req|
req.body = "{\n \"algorithm\": \"\",\n \"hash\": \"\",\n \"input\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/VerifyHash";
let payload = json!({
"algorithm": "",
"hash": "",
"input": ""
});
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}}/VerifyHash \
--header 'content-type: application/json' \
--data '{
"algorithm": "",
"hash": "",
"input": ""
}'
echo '{
"algorithm": "",
"hash": "",
"input": ""
}' | \
http POST {{baseUrl}}/VerifyHash \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "algorithm": "",\n "hash": "",\n "input": ""\n}' \
--output-document \
- {{baseUrl}}/VerifyHash
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"algorithm": "",
"hash": "",
"input": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/VerifyHash")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": true
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"result": "string"
}