RCPCH Digital Growth API
POST
Cdc Bulk Calculation
{{baseUrl}}/cdc/bulk-calculation
BODY json
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cdc/bulk-calculation");
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cdc/bulk-calculation" {:content-type :json
:form-params {:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""
:observations [{:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""}]}})
require "http/client"
url = "{{baseUrl}}/cdc/bulk-calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/cdc/bulk-calculation"),
Content = new StringContent("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/cdc/bulk-calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cdc/bulk-calculation"
payload := strings.NewReader("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/cdc/bulk-calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 366
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cdc/bulk-calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cdc/bulk-calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cdc/bulk-calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cdc/bulk-calculation")
.header("content-type", "application/json")
.body("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cdc/bulk-calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cdc/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cdc/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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}}/cdc/bulk-calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cdc/bulk-calculation")
.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/cdc/bulk-calculation',
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({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cdc/bulk-calculation',
headers: {'content-type': 'application/json'},
body: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
},
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}}/cdc/bulk-calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
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}}/cdc/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cdc/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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 = @{ @"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"",
@"observations": @[ @{ @"observation_date": @"", @"observation_value": @"", @"bone_age": @"", @"bone_age_type": @"", @"bone_age_sds": @"", @"bone_age_centile": @"", @"bone_age_text": @"", @"events_text": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cdc/bulk-calculation"]
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}}/cdc/bulk-calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cdc/bulk-calculation",
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([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]),
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}}/cdc/bulk-calculation', [
'body' => '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cdc/bulk-calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/cdc/bulk-calculation');
$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}}/cdc/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cdc/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/cdc/bulk-calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cdc/bulk-calculation"
payload = {
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cdc/bulk-calculation"
payload <- "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/cdc/bulk-calculation")
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/cdc/bulk-calculation') do |req|
req.body = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cdc/bulk-calculation";
let payload = json!({
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": (
json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
})
)
});
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}}/cdc/bulk-calculation \
--header 'content-type: application/json' \
--data '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
echo '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}' | \
http POST {{baseUrl}}/cdc/bulk-calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/cdc/bulk-calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
[
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cdc/bulk-calculation")! 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()
POST
Cdc Calculation
{{baseUrl}}/cdc/calculation
BODY json
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cdc/calculation");
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cdc/calculation" {:content-type :json
:form-params {:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""
:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""}})
require "http/client"
url = "{{baseUrl}}/cdc/calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/cdc/calculation"),
Content = new StringContent("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/cdc/calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cdc/calculation"
payload := strings.NewReader("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/cdc/calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 298
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cdc/calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cdc/calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cdc/calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cdc/calculation")
.header("content-type", "application/json")
.body("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.asString();
const data = JSON.stringify({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cdc/calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cdc/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cdc/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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}}/cdc/calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cdc/calculation")
.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/cdc/calculation',
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({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cdc/calculation',
headers: {'content-type': 'application/json'},
body: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
},
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}}/cdc/calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
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}}/cdc/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cdc/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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 = @{ @"observation_date": @"",
@"observation_value": @"",
@"bone_age": @"",
@"bone_age_type": @"",
@"bone_age_sds": @"",
@"bone_age_centile": @"",
@"bone_age_text": @"",
@"events_text": @"",
@"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cdc/calculation"]
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}}/cdc/calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cdc/calculation",
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([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]),
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}}/cdc/calculation', [
'body' => '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cdc/calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cdc/calculation');
$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}}/cdc/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cdc/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/cdc/calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cdc/calculation"
payload = {
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cdc/calculation"
payload <- "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/cdc/calculation")
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/cdc/calculation') do |req|
req.body = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cdc/calculation";
let payload = json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
});
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}}/cdc/calculation \
--header 'content-type: application/json' \
--data '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
echo '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}' | \
http POST {{baseUrl}}/cdc/calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}' \
--output-document \
- {{baseUrl}}/cdc/calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cdc/calculation")! 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()
POST
Cdc Chart Coordinates
{{baseUrl}}/cdc/chart-coordinates
BODY json
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cdc/chart-coordinates");
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cdc/chart-coordinates" {:content-type :json
:form-params {:sex ""
:measurement_method ""
:is_sds false
:centile_format ""}})
require "http/client"
url = "{{baseUrl}}/cdc/chart-coordinates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/cdc/chart-coordinates"),
Content = new StringContent("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/cdc/chart-coordinates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cdc/chart-coordinates"
payload := strings.NewReader("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/cdc/chart-coordinates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 86
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cdc/chart-coordinates")
.setHeader("content-type", "application/json")
.setBody("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cdc/chart-coordinates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cdc/chart-coordinates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cdc/chart-coordinates")
.header("content-type", "application/json")
.body("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.asString();
const data = JSON.stringify({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cdc/chart-coordinates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cdc/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cdc/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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}}/cdc/chart-coordinates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cdc/chart-coordinates")
.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/cdc/chart-coordinates',
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({sex: '', measurement_method: '', is_sds: false, centile_format: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cdc/chart-coordinates',
headers: {'content-type': 'application/json'},
body: {sex: '', measurement_method: '', is_sds: false, centile_format: ''},
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}}/cdc/chart-coordinates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
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}}/cdc/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cdc/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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 = @{ @"sex": @"",
@"measurement_method": @"",
@"is_sds": @NO,
@"centile_format": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cdc/chart-coordinates"]
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}}/cdc/chart-coordinates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cdc/chart-coordinates",
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([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]),
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}}/cdc/chart-coordinates', [
'body' => '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cdc/chart-coordinates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cdc/chart-coordinates');
$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}}/cdc/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cdc/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/cdc/chart-coordinates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cdc/chart-coordinates"
payload = {
"sex": "",
"measurement_method": "",
"is_sds": False,
"centile_format": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cdc/chart-coordinates"
payload <- "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/cdc/chart-coordinates")
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/cdc/chart-coordinates') do |req|
req.body = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cdc/chart-coordinates";
let payload = json!({
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
});
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}}/cdc/chart-coordinates \
--header 'content-type: application/json' \
--data '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
echo '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}' | \
http POST {{baseUrl}}/cdc/chart-coordinates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}' \
--output-document \
- {{baseUrl}}/cdc/chart-coordinates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cdc/chart-coordinates")! 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()
POST
Fictional Child Data (3)
{{baseUrl}}/cdc/fictional-child-data
BODY json
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cdc/fictional-child-data");
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cdc/fictional-child-data" {:content-type :json
:form-params {:measurement_method ""
:sex ""
:start_chronological_age ""
:end_age ""
:gestation_weeks ""
:gestation_days ""
:measurement_interval_type ""
:measurement_interval_number ""
:start_sds ""
:drift false
:drift_range ""
:noise false
:noise_range ""}})
require "http/client"
url = "{{baseUrl}}/cdc/fictional-child-data"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/cdc/fictional-child-data"),
Content = new StringContent("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/cdc/fictional-child-data");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cdc/fictional-child-data"
payload := strings.NewReader("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/cdc/fictional-child-data HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 311
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cdc/fictional-child-data")
.setHeader("content-type", "application/json")
.setBody("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cdc/fictional-child-data"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cdc/fictional-child-data")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cdc/fictional-child-data")
.header("content-type", "application/json")
.body("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.asString();
const data = JSON.stringify({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cdc/fictional-child-data');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cdc/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cdc/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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}}/cdc/fictional-child-data',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cdc/fictional-child-data")
.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/cdc/fictional-child-data',
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({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cdc/fictional-child-data',
headers: {'content-type': 'application/json'},
body: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
},
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}}/cdc/fictional-child-data');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
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}}/cdc/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cdc/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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 = @{ @"measurement_method": @"",
@"sex": @"",
@"start_chronological_age": @"",
@"end_age": @"",
@"gestation_weeks": @"",
@"gestation_days": @"",
@"measurement_interval_type": @"",
@"measurement_interval_number": @"",
@"start_sds": @"",
@"drift": @NO,
@"drift_range": @"",
@"noise": @NO,
@"noise_range": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cdc/fictional-child-data"]
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}}/cdc/fictional-child-data" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cdc/fictional-child-data",
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([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]),
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}}/cdc/fictional-child-data', [
'body' => '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cdc/fictional-child-data');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cdc/fictional-child-data');
$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}}/cdc/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cdc/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/cdc/fictional-child-data", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cdc/fictional-child-data"
payload = {
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": False,
"drift_range": "",
"noise": False,
"noise_range": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cdc/fictional-child-data"
payload <- "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/cdc/fictional-child-data")
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/cdc/fictional-child-data') do |req|
req.body = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cdc/fictional-child-data";
let payload = json!({
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
});
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}}/cdc/fictional-child-data \
--header 'content-type: application/json' \
--data '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
echo '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}' | \
http POST {{baseUrl}}/cdc/fictional-child-data \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}' \
--output-document \
- {{baseUrl}}/cdc/fictional-child-data
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cdc/fictional-child-data")! 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()
GET
Root
{{baseUrl}}/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/")
require "http/client"
url = "{{baseUrl}}/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/');
echo $response->getBody();
setUrl('{{baseUrl}}/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/
http GET {{baseUrl}}/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Fictional Child Data (1)
{{baseUrl}}/trisomy-21/fictional-child-data
BODY json
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/trisomy-21/fictional-child-data");
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/trisomy-21/fictional-child-data" {:content-type :json
:form-params {:measurement_method ""
:sex ""
:start_chronological_age ""
:end_age ""
:gestation_weeks ""
:gestation_days ""
:measurement_interval_type ""
:measurement_interval_number ""
:start_sds ""
:drift false
:drift_range ""
:noise false
:noise_range ""}})
require "http/client"
url = "{{baseUrl}}/trisomy-21/fictional-child-data"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/trisomy-21/fictional-child-data"),
Content = new StringContent("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/trisomy-21/fictional-child-data");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/trisomy-21/fictional-child-data"
payload := strings.NewReader("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/trisomy-21/fictional-child-data HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 311
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/trisomy-21/fictional-child-data")
.setHeader("content-type", "application/json")
.setBody("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/trisomy-21/fictional-child-data"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/trisomy-21/fictional-child-data")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/trisomy-21/fictional-child-data")
.header("content-type", "application/json")
.body("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.asString();
const data = JSON.stringify({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/trisomy-21/fictional-child-data');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/trisomy-21/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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}}/trisomy-21/fictional-child-data',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/trisomy-21/fictional-child-data")
.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/trisomy-21/fictional-child-data',
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({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21/fictional-child-data',
headers: {'content-type': 'application/json'},
body: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
},
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}}/trisomy-21/fictional-child-data');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
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}}/trisomy-21/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/trisomy-21/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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 = @{ @"measurement_method": @"",
@"sex": @"",
@"start_chronological_age": @"",
@"end_age": @"",
@"gestation_weeks": @"",
@"gestation_days": @"",
@"measurement_interval_type": @"",
@"measurement_interval_number": @"",
@"start_sds": @"",
@"drift": @NO,
@"drift_range": @"",
@"noise": @NO,
@"noise_range": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/trisomy-21/fictional-child-data"]
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}}/trisomy-21/fictional-child-data" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/trisomy-21/fictional-child-data",
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([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]),
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}}/trisomy-21/fictional-child-data', [
'body' => '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/trisomy-21/fictional-child-data');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
$request->setRequestUrl('{{baseUrl}}/trisomy-21/fictional-child-data');
$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}}/trisomy-21/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/trisomy-21/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/trisomy-21/fictional-child-data", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/trisomy-21/fictional-child-data"
payload = {
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": False,
"drift_range": "",
"noise": False,
"noise_range": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/trisomy-21/fictional-child-data"
payload <- "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/trisomy-21/fictional-child-data")
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/trisomy-21/fictional-child-data') do |req|
req.body = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/trisomy-21/fictional-child-data";
let payload = json!({
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
});
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}}/trisomy-21/fictional-child-data \
--header 'content-type: application/json' \
--data '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
echo '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}' | \
http POST {{baseUrl}}/trisomy-21/fictional-child-data \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}' \
--output-document \
- {{baseUrl}}/trisomy-21/fictional-child-data
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/trisomy-21/fictional-child-data")! 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()
POST
Trisomy 21 Bulk Calculation
{{baseUrl}}/trisomy-21/bulk-calculation
BODY json
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/trisomy-21/bulk-calculation");
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/trisomy-21/bulk-calculation" {:content-type :json
:form-params {:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""
:observations [{:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""}]}})
require "http/client"
url = "{{baseUrl}}/trisomy-21/bulk-calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/trisomy-21/bulk-calculation"),
Content = new StringContent("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/trisomy-21/bulk-calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/trisomy-21/bulk-calculation"
payload := strings.NewReader("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/trisomy-21/bulk-calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 366
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/trisomy-21/bulk-calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/trisomy-21/bulk-calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/trisomy-21/bulk-calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/trisomy-21/bulk-calculation")
.header("content-type", "application/json")
.body("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/trisomy-21/bulk-calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/trisomy-21/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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}}/trisomy-21/bulk-calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/trisomy-21/bulk-calculation")
.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/trisomy-21/bulk-calculation',
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({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21/bulk-calculation',
headers: {'content-type': 'application/json'},
body: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
},
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}}/trisomy-21/bulk-calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
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}}/trisomy-21/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/trisomy-21/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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 = @{ @"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"",
@"observations": @[ @{ @"observation_date": @"", @"observation_value": @"", @"bone_age": @"", @"bone_age_type": @"", @"bone_age_sds": @"", @"bone_age_centile": @"", @"bone_age_text": @"", @"events_text": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/trisomy-21/bulk-calculation"]
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}}/trisomy-21/bulk-calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/trisomy-21/bulk-calculation",
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([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]),
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}}/trisomy-21/bulk-calculation', [
'body' => '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/trisomy-21/bulk-calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/trisomy-21/bulk-calculation');
$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}}/trisomy-21/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/trisomy-21/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/trisomy-21/bulk-calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/trisomy-21/bulk-calculation"
payload = {
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/trisomy-21/bulk-calculation"
payload <- "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/trisomy-21/bulk-calculation")
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/trisomy-21/bulk-calculation') do |req|
req.body = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/trisomy-21/bulk-calculation";
let payload = json!({
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": (
json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
})
)
});
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}}/trisomy-21/bulk-calculation \
--header 'content-type: application/json' \
--data '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
echo '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}' | \
http POST {{baseUrl}}/trisomy-21/bulk-calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/trisomy-21/bulk-calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
[
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/trisomy-21/bulk-calculation")! 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()
POST
Trisomy 21 Calculation
{{baseUrl}}/trisomy-21/calculation
BODY json
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/trisomy-21/calculation");
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/trisomy-21/calculation" {:content-type :json
:form-params {:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""
:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""}})
require "http/client"
url = "{{baseUrl}}/trisomy-21/calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/trisomy-21/calculation"),
Content = new StringContent("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/trisomy-21/calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/trisomy-21/calculation"
payload := strings.NewReader("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/trisomy-21/calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 298
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/trisomy-21/calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/trisomy-21/calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/trisomy-21/calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/trisomy-21/calculation")
.header("content-type", "application/json")
.body("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.asString();
const data = JSON.stringify({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/trisomy-21/calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/trisomy-21/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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}}/trisomy-21/calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/trisomy-21/calculation")
.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/trisomy-21/calculation',
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({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21/calculation',
headers: {'content-type': 'application/json'},
body: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
},
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}}/trisomy-21/calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
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}}/trisomy-21/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/trisomy-21/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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 = @{ @"observation_date": @"",
@"observation_value": @"",
@"bone_age": @"",
@"bone_age_type": @"",
@"bone_age_sds": @"",
@"bone_age_centile": @"",
@"bone_age_text": @"",
@"events_text": @"",
@"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/trisomy-21/calculation"]
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}}/trisomy-21/calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/trisomy-21/calculation",
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([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]),
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}}/trisomy-21/calculation', [
'body' => '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/trisomy-21/calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
$request->setRequestUrl('{{baseUrl}}/trisomy-21/calculation');
$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}}/trisomy-21/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/trisomy-21/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/trisomy-21/calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/trisomy-21/calculation"
payload = {
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/trisomy-21/calculation"
payload <- "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/trisomy-21/calculation")
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/trisomy-21/calculation') do |req|
req.body = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/trisomy-21/calculation";
let payload = json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
});
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}}/trisomy-21/calculation \
--header 'content-type: application/json' \
--data '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
echo '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}' | \
http POST {{baseUrl}}/trisomy-21/calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}' \
--output-document \
- {{baseUrl}}/trisomy-21/calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/trisomy-21/calculation")! 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()
POST
Trisomy 21 Chart Coordinates
{{baseUrl}}/trisomy-21/chart-coordinates
BODY json
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/trisomy-21/chart-coordinates");
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/trisomy-21/chart-coordinates" {:content-type :json
:form-params {:sex ""
:measurement_method ""
:is_sds false
:centile_format ""}})
require "http/client"
url = "{{baseUrl}}/trisomy-21/chart-coordinates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/trisomy-21/chart-coordinates"),
Content = new StringContent("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/trisomy-21/chart-coordinates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/trisomy-21/chart-coordinates"
payload := strings.NewReader("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/trisomy-21/chart-coordinates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 86
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/trisomy-21/chart-coordinates")
.setHeader("content-type", "application/json")
.setBody("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/trisomy-21/chart-coordinates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/trisomy-21/chart-coordinates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/trisomy-21/chart-coordinates")
.header("content-type", "application/json")
.body("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.asString();
const data = JSON.stringify({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/trisomy-21/chart-coordinates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/trisomy-21/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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}}/trisomy-21/chart-coordinates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/trisomy-21/chart-coordinates")
.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/trisomy-21/chart-coordinates',
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({sex: '', measurement_method: '', is_sds: false, centile_format: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21/chart-coordinates',
headers: {'content-type': 'application/json'},
body: {sex: '', measurement_method: '', is_sds: false, centile_format: ''},
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}}/trisomy-21/chart-coordinates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
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}}/trisomy-21/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/trisomy-21/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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 = @{ @"sex": @"",
@"measurement_method": @"",
@"is_sds": @NO,
@"centile_format": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/trisomy-21/chart-coordinates"]
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}}/trisomy-21/chart-coordinates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/trisomy-21/chart-coordinates",
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([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]),
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}}/trisomy-21/chart-coordinates', [
'body' => '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/trisomy-21/chart-coordinates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
$request->setRequestUrl('{{baseUrl}}/trisomy-21/chart-coordinates');
$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}}/trisomy-21/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/trisomy-21/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/trisomy-21/chart-coordinates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/trisomy-21/chart-coordinates"
payload = {
"sex": "",
"measurement_method": "",
"is_sds": False,
"centile_format": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/trisomy-21/chart-coordinates"
payload <- "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/trisomy-21/chart-coordinates")
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/trisomy-21/chart-coordinates') do |req|
req.body = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/trisomy-21/chart-coordinates";
let payload = json!({
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
});
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}}/trisomy-21/chart-coordinates \
--header 'content-type: application/json' \
--data '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
echo '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}' | \
http POST {{baseUrl}}/trisomy-21/chart-coordinates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}' \
--output-document \
- {{baseUrl}}/trisomy-21/chart-coordinates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/trisomy-21/chart-coordinates")! 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()
POST
Fictional Child Data (2)
{{baseUrl}}/trisomy-21-aap/fictional-child-data
BODY json
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/trisomy-21-aap/fictional-child-data");
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/trisomy-21-aap/fictional-child-data" {:content-type :json
:form-params {:measurement_method ""
:sex ""
:start_chronological_age ""
:end_age ""
:gestation_weeks ""
:gestation_days ""
:measurement_interval_type ""
:measurement_interval_number ""
:start_sds ""
:drift false
:drift_range ""
:noise false
:noise_range ""}})
require "http/client"
url = "{{baseUrl}}/trisomy-21-aap/fictional-child-data"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/trisomy-21-aap/fictional-child-data"),
Content = new StringContent("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/trisomy-21-aap/fictional-child-data");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/trisomy-21-aap/fictional-child-data"
payload := strings.NewReader("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/trisomy-21-aap/fictional-child-data HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 311
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/trisomy-21-aap/fictional-child-data")
.setHeader("content-type", "application/json")
.setBody("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/trisomy-21-aap/fictional-child-data"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/trisomy-21-aap/fictional-child-data")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/trisomy-21-aap/fictional-child-data")
.header("content-type", "application/json")
.body("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.asString();
const data = JSON.stringify({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/trisomy-21-aap/fictional-child-data');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21-aap/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/trisomy-21-aap/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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}}/trisomy-21-aap/fictional-child-data',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/trisomy-21-aap/fictional-child-data")
.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/trisomy-21-aap/fictional-child-data',
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({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21-aap/fictional-child-data',
headers: {'content-type': 'application/json'},
body: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
},
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}}/trisomy-21-aap/fictional-child-data');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
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}}/trisomy-21-aap/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/trisomy-21-aap/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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 = @{ @"measurement_method": @"",
@"sex": @"",
@"start_chronological_age": @"",
@"end_age": @"",
@"gestation_weeks": @"",
@"gestation_days": @"",
@"measurement_interval_type": @"",
@"measurement_interval_number": @"",
@"start_sds": @"",
@"drift": @NO,
@"drift_range": @"",
@"noise": @NO,
@"noise_range": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/trisomy-21-aap/fictional-child-data"]
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}}/trisomy-21-aap/fictional-child-data" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/trisomy-21-aap/fictional-child-data",
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([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]),
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}}/trisomy-21-aap/fictional-child-data', [
'body' => '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/trisomy-21-aap/fictional-child-data');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
$request->setRequestUrl('{{baseUrl}}/trisomy-21-aap/fictional-child-data');
$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}}/trisomy-21-aap/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/trisomy-21-aap/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/trisomy-21-aap/fictional-child-data", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/trisomy-21-aap/fictional-child-data"
payload = {
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": False,
"drift_range": "",
"noise": False,
"noise_range": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/trisomy-21-aap/fictional-child-data"
payload <- "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/trisomy-21-aap/fictional-child-data")
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/trisomy-21-aap/fictional-child-data') do |req|
req.body = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/trisomy-21-aap/fictional-child-data";
let payload = json!({
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
});
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}}/trisomy-21-aap/fictional-child-data \
--header 'content-type: application/json' \
--data '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
echo '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}' | \
http POST {{baseUrl}}/trisomy-21-aap/fictional-child-data \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}' \
--output-document \
- {{baseUrl}}/trisomy-21-aap/fictional-child-data
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/trisomy-21-aap/fictional-child-data")! 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()
POST
Trisomy 21 Aap Bulk Calculation
{{baseUrl}}/trisomy-21-aap/bulk-calculation
BODY json
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/trisomy-21-aap/bulk-calculation");
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/trisomy-21-aap/bulk-calculation" {:content-type :json
:form-params {:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""
:observations [{:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""}]}})
require "http/client"
url = "{{baseUrl}}/trisomy-21-aap/bulk-calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/trisomy-21-aap/bulk-calculation"),
Content = new StringContent("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/trisomy-21-aap/bulk-calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/trisomy-21-aap/bulk-calculation"
payload := strings.NewReader("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/trisomy-21-aap/bulk-calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 366
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/trisomy-21-aap/bulk-calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/trisomy-21-aap/bulk-calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/trisomy-21-aap/bulk-calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/trisomy-21-aap/bulk-calculation")
.header("content-type", "application/json")
.body("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/trisomy-21-aap/bulk-calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21-aap/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/trisomy-21-aap/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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}}/trisomy-21-aap/bulk-calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/trisomy-21-aap/bulk-calculation")
.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/trisomy-21-aap/bulk-calculation',
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({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21-aap/bulk-calculation',
headers: {'content-type': 'application/json'},
body: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
},
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}}/trisomy-21-aap/bulk-calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
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}}/trisomy-21-aap/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/trisomy-21-aap/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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 = @{ @"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"",
@"observations": @[ @{ @"observation_date": @"", @"observation_value": @"", @"bone_age": @"", @"bone_age_type": @"", @"bone_age_sds": @"", @"bone_age_centile": @"", @"bone_age_text": @"", @"events_text": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/trisomy-21-aap/bulk-calculation"]
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}}/trisomy-21-aap/bulk-calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/trisomy-21-aap/bulk-calculation",
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([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]),
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}}/trisomy-21-aap/bulk-calculation', [
'body' => '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/trisomy-21-aap/bulk-calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/trisomy-21-aap/bulk-calculation');
$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}}/trisomy-21-aap/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/trisomy-21-aap/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/trisomy-21-aap/bulk-calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/trisomy-21-aap/bulk-calculation"
payload = {
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/trisomy-21-aap/bulk-calculation"
payload <- "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/trisomy-21-aap/bulk-calculation")
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/trisomy-21-aap/bulk-calculation') do |req|
req.body = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/trisomy-21-aap/bulk-calculation";
let payload = json!({
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": (
json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
})
)
});
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}}/trisomy-21-aap/bulk-calculation \
--header 'content-type: application/json' \
--data '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
echo '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}' | \
http POST {{baseUrl}}/trisomy-21-aap/bulk-calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/trisomy-21-aap/bulk-calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
[
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/trisomy-21-aap/bulk-calculation")! 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()
POST
Trisomy 21 Aap Calculation
{{baseUrl}}/trisomy-21-aap/calculation
BODY json
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/trisomy-21-aap/calculation");
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/trisomy-21-aap/calculation" {:content-type :json
:form-params {:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""
:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""}})
require "http/client"
url = "{{baseUrl}}/trisomy-21-aap/calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/trisomy-21-aap/calculation"),
Content = new StringContent("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/trisomy-21-aap/calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/trisomy-21-aap/calculation"
payload := strings.NewReader("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/trisomy-21-aap/calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 298
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/trisomy-21-aap/calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/trisomy-21-aap/calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/trisomy-21-aap/calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/trisomy-21-aap/calculation")
.header("content-type", "application/json")
.body("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.asString();
const data = JSON.stringify({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/trisomy-21-aap/calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21-aap/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/trisomy-21-aap/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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}}/trisomy-21-aap/calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/trisomy-21-aap/calculation")
.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/trisomy-21-aap/calculation',
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({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21-aap/calculation',
headers: {'content-type': 'application/json'},
body: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
},
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}}/trisomy-21-aap/calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
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}}/trisomy-21-aap/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/trisomy-21-aap/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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 = @{ @"observation_date": @"",
@"observation_value": @"",
@"bone_age": @"",
@"bone_age_type": @"",
@"bone_age_sds": @"",
@"bone_age_centile": @"",
@"bone_age_text": @"",
@"events_text": @"",
@"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/trisomy-21-aap/calculation"]
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}}/trisomy-21-aap/calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/trisomy-21-aap/calculation",
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([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]),
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}}/trisomy-21-aap/calculation', [
'body' => '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/trisomy-21-aap/calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
$request->setRequestUrl('{{baseUrl}}/trisomy-21-aap/calculation');
$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}}/trisomy-21-aap/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/trisomy-21-aap/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/trisomy-21-aap/calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/trisomy-21-aap/calculation"
payload = {
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/trisomy-21-aap/calculation"
payload <- "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/trisomy-21-aap/calculation")
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/trisomy-21-aap/calculation') do |req|
req.body = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/trisomy-21-aap/calculation";
let payload = json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
});
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}}/trisomy-21-aap/calculation \
--header 'content-type: application/json' \
--data '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
echo '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}' | \
http POST {{baseUrl}}/trisomy-21-aap/calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}' \
--output-document \
- {{baseUrl}}/trisomy-21-aap/calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/trisomy-21-aap/calculation")! 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()
POST
Trisomy 21 Aap Chart Coordinates
{{baseUrl}}/trisomy-21-aap/chart-coordinates
BODY json
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/trisomy-21-aap/chart-coordinates");
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/trisomy-21-aap/chart-coordinates" {:content-type :json
:form-params {:sex ""
:measurement_method ""
:is_sds false
:centile_format ""}})
require "http/client"
url = "{{baseUrl}}/trisomy-21-aap/chart-coordinates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/trisomy-21-aap/chart-coordinates"),
Content = new StringContent("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/trisomy-21-aap/chart-coordinates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/trisomy-21-aap/chart-coordinates"
payload := strings.NewReader("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/trisomy-21-aap/chart-coordinates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 86
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/trisomy-21-aap/chart-coordinates")
.setHeader("content-type", "application/json")
.setBody("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/trisomy-21-aap/chart-coordinates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/trisomy-21-aap/chart-coordinates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/trisomy-21-aap/chart-coordinates")
.header("content-type", "application/json")
.body("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.asString();
const data = JSON.stringify({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/trisomy-21-aap/chart-coordinates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21-aap/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/trisomy-21-aap/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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}}/trisomy-21-aap/chart-coordinates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/trisomy-21-aap/chart-coordinates")
.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/trisomy-21-aap/chart-coordinates',
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({sex: '', measurement_method: '', is_sds: false, centile_format: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/trisomy-21-aap/chart-coordinates',
headers: {'content-type': 'application/json'},
body: {sex: '', measurement_method: '', is_sds: false, centile_format: ''},
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}}/trisomy-21-aap/chart-coordinates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
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}}/trisomy-21-aap/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/trisomy-21-aap/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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 = @{ @"sex": @"",
@"measurement_method": @"",
@"is_sds": @NO,
@"centile_format": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/trisomy-21-aap/chart-coordinates"]
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}}/trisomy-21-aap/chart-coordinates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/trisomy-21-aap/chart-coordinates",
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([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]),
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}}/trisomy-21-aap/chart-coordinates', [
'body' => '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/trisomy-21-aap/chart-coordinates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
$request->setRequestUrl('{{baseUrl}}/trisomy-21-aap/chart-coordinates');
$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}}/trisomy-21-aap/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/trisomy-21-aap/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/trisomy-21-aap/chart-coordinates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/trisomy-21-aap/chart-coordinates"
payload = {
"sex": "",
"measurement_method": "",
"is_sds": False,
"centile_format": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/trisomy-21-aap/chart-coordinates"
payload <- "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/trisomy-21-aap/chart-coordinates")
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/trisomy-21-aap/chart-coordinates') do |req|
req.body = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/trisomy-21-aap/chart-coordinates";
let payload = json!({
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
});
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}}/trisomy-21-aap/chart-coordinates \
--header 'content-type: application/json' \
--data '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
echo '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}' | \
http POST {{baseUrl}}/trisomy-21-aap/chart-coordinates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}' \
--output-document \
- {{baseUrl}}/trisomy-21-aap/chart-coordinates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/trisomy-21-aap/chart-coordinates")! 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()
POST
Fictional Child Data (POST)
{{baseUrl}}/turner/fictional-child-data
BODY json
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/turner/fictional-child-data");
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/turner/fictional-child-data" {:content-type :json
:form-params {:measurement_method ""
:sex ""
:start_chronological_age ""
:end_age ""
:gestation_weeks ""
:gestation_days ""
:measurement_interval_type ""
:measurement_interval_number ""
:start_sds ""
:drift false
:drift_range ""
:noise false
:noise_range ""}})
require "http/client"
url = "{{baseUrl}}/turner/fictional-child-data"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/turner/fictional-child-data"),
Content = new StringContent("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/turner/fictional-child-data");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/turner/fictional-child-data"
payload := strings.NewReader("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/turner/fictional-child-data HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 311
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/turner/fictional-child-data")
.setHeader("content-type", "application/json")
.setBody("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/turner/fictional-child-data"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/turner/fictional-child-data")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/turner/fictional-child-data")
.header("content-type", "application/json")
.body("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.asString();
const data = JSON.stringify({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/turner/fictional-child-data');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/turner/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/turner/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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}}/turner/fictional-child-data',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/turner/fictional-child-data")
.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/turner/fictional-child-data',
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({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/turner/fictional-child-data',
headers: {'content-type': 'application/json'},
body: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
},
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}}/turner/fictional-child-data');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
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}}/turner/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/turner/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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 = @{ @"measurement_method": @"",
@"sex": @"",
@"start_chronological_age": @"",
@"end_age": @"",
@"gestation_weeks": @"",
@"gestation_days": @"",
@"measurement_interval_type": @"",
@"measurement_interval_number": @"",
@"start_sds": @"",
@"drift": @NO,
@"drift_range": @"",
@"noise": @NO,
@"noise_range": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/turner/fictional-child-data"]
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}}/turner/fictional-child-data" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/turner/fictional-child-data",
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([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]),
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}}/turner/fictional-child-data', [
'body' => '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/turner/fictional-child-data');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
$request->setRequestUrl('{{baseUrl}}/turner/fictional-child-data');
$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}}/turner/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/turner/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/turner/fictional-child-data", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/turner/fictional-child-data"
payload = {
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": False,
"drift_range": "",
"noise": False,
"noise_range": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/turner/fictional-child-data"
payload <- "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/turner/fictional-child-data")
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/turner/fictional-child-data') do |req|
req.body = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/turner/fictional-child-data";
let payload = json!({
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
});
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}}/turner/fictional-child-data \
--header 'content-type: application/json' \
--data '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
echo '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}' | \
http POST {{baseUrl}}/turner/fictional-child-data \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}' \
--output-document \
- {{baseUrl}}/turner/fictional-child-data
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/turner/fictional-child-data")! 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()
POST
Turner Bulk Calculation
{{baseUrl}}/turner/bulk-calculation
BODY json
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/turner/bulk-calculation");
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/turner/bulk-calculation" {:content-type :json
:form-params {:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""
:observations [{:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""}]}})
require "http/client"
url = "{{baseUrl}}/turner/bulk-calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/turner/bulk-calculation"),
Content = new StringContent("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/turner/bulk-calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/turner/bulk-calculation"
payload := strings.NewReader("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/turner/bulk-calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 366
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/turner/bulk-calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/turner/bulk-calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/turner/bulk-calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/turner/bulk-calculation")
.header("content-type", "application/json")
.body("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/turner/bulk-calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/turner/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/turner/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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}}/turner/bulk-calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/turner/bulk-calculation")
.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/turner/bulk-calculation',
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({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/turner/bulk-calculation',
headers: {'content-type': 'application/json'},
body: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
},
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}}/turner/bulk-calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
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}}/turner/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/turner/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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 = @{ @"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"",
@"observations": @[ @{ @"observation_date": @"", @"observation_value": @"", @"bone_age": @"", @"bone_age_type": @"", @"bone_age_sds": @"", @"bone_age_centile": @"", @"bone_age_text": @"", @"events_text": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/turner/bulk-calculation"]
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}}/turner/bulk-calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/turner/bulk-calculation",
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([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]),
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}}/turner/bulk-calculation', [
'body' => '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/turner/bulk-calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/turner/bulk-calculation');
$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}}/turner/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/turner/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/turner/bulk-calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/turner/bulk-calculation"
payload = {
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/turner/bulk-calculation"
payload <- "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/turner/bulk-calculation")
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/turner/bulk-calculation') do |req|
req.body = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/turner/bulk-calculation";
let payload = json!({
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": (
json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
})
)
});
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}}/turner/bulk-calculation \
--header 'content-type: application/json' \
--data '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
echo '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}' | \
http POST {{baseUrl}}/turner/bulk-calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/turner/bulk-calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
[
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/turner/bulk-calculation")! 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()
POST
Turner Calculation
{{baseUrl}}/turner/calculation
BODY json
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/turner/calculation");
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/turner/calculation" {:content-type :json
:form-params {:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""
:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""}})
require "http/client"
url = "{{baseUrl}}/turner/calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/turner/calculation"),
Content = new StringContent("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/turner/calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/turner/calculation"
payload := strings.NewReader("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/turner/calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 298
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/turner/calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/turner/calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/turner/calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/turner/calculation")
.header("content-type", "application/json")
.body("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.asString();
const data = JSON.stringify({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/turner/calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/turner/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/turner/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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}}/turner/calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/turner/calculation")
.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/turner/calculation',
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({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/turner/calculation',
headers: {'content-type': 'application/json'},
body: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
},
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}}/turner/calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
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}}/turner/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/turner/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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 = @{ @"observation_date": @"",
@"observation_value": @"",
@"bone_age": @"",
@"bone_age_type": @"",
@"bone_age_sds": @"",
@"bone_age_centile": @"",
@"bone_age_text": @"",
@"events_text": @"",
@"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/turner/calculation"]
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}}/turner/calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/turner/calculation",
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([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]),
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}}/turner/calculation', [
'body' => '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/turner/calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
$request->setRequestUrl('{{baseUrl}}/turner/calculation');
$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}}/turner/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/turner/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/turner/calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/turner/calculation"
payload = {
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/turner/calculation"
payload <- "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/turner/calculation")
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/turner/calculation') do |req|
req.body = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/turner/calculation";
let payload = json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
});
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}}/turner/calculation \
--header 'content-type: application/json' \
--data '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
echo '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}' | \
http POST {{baseUrl}}/turner/calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}' \
--output-document \
- {{baseUrl}}/turner/calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/turner/calculation")! 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()
POST
Turner Chart Coordinates
{{baseUrl}}/turner/chart-coordinates
BODY json
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/turner/chart-coordinates");
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/turner/chart-coordinates" {:content-type :json
:form-params {:sex ""
:measurement_method ""
:is_sds false
:centile_format ""}})
require "http/client"
url = "{{baseUrl}}/turner/chart-coordinates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/turner/chart-coordinates"),
Content = new StringContent("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/turner/chart-coordinates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/turner/chart-coordinates"
payload := strings.NewReader("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/turner/chart-coordinates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 86
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/turner/chart-coordinates")
.setHeader("content-type", "application/json")
.setBody("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/turner/chart-coordinates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/turner/chart-coordinates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/turner/chart-coordinates")
.header("content-type", "application/json")
.body("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.asString();
const data = JSON.stringify({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/turner/chart-coordinates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/turner/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/turner/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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}}/turner/chart-coordinates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/turner/chart-coordinates")
.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/turner/chart-coordinates',
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({sex: '', measurement_method: '', is_sds: false, centile_format: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/turner/chart-coordinates',
headers: {'content-type': 'application/json'},
body: {sex: '', measurement_method: '', is_sds: false, centile_format: ''},
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}}/turner/chart-coordinates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
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}}/turner/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/turner/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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 = @{ @"sex": @"",
@"measurement_method": @"",
@"is_sds": @NO,
@"centile_format": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/turner/chart-coordinates"]
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}}/turner/chart-coordinates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/turner/chart-coordinates",
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([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]),
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}}/turner/chart-coordinates', [
'body' => '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/turner/chart-coordinates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
$request->setRequestUrl('{{baseUrl}}/turner/chart-coordinates');
$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}}/turner/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/turner/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/turner/chart-coordinates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/turner/chart-coordinates"
payload = {
"sex": "",
"measurement_method": "",
"is_sds": False,
"centile_format": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/turner/chart-coordinates"
payload <- "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/turner/chart-coordinates")
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/turner/chart-coordinates') do |req|
req.body = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/turner/chart-coordinates";
let payload = json!({
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
});
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}}/turner/chart-coordinates \
--header 'content-type: application/json' \
--data '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
echo '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}' | \
http POST {{baseUrl}}/turner/chart-coordinates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}' \
--output-document \
- {{baseUrl}}/turner/chart-coordinates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/turner/chart-coordinates")! 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()
POST
Fictional Child Data
{{baseUrl}}/uk-who/fictional-child-data
BODY json
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/uk-who/fictional-child-data");
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/uk-who/fictional-child-data" {:content-type :json
:form-params {:measurement_method ""
:sex ""
:start_chronological_age ""
:end_age ""
:gestation_weeks ""
:gestation_days ""
:measurement_interval_type ""
:measurement_interval_number ""
:start_sds ""
:drift false
:drift_range ""
:noise false
:noise_range ""}})
require "http/client"
url = "{{baseUrl}}/uk-who/fictional-child-data"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/uk-who/fictional-child-data"),
Content = new StringContent("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/uk-who/fictional-child-data");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/uk-who/fictional-child-data"
payload := strings.NewReader("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/uk-who/fictional-child-data HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 311
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/uk-who/fictional-child-data")
.setHeader("content-type", "application/json")
.setBody("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/uk-who/fictional-child-data"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/uk-who/fictional-child-data")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/uk-who/fictional-child-data")
.header("content-type", "application/json")
.body("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.asString();
const data = JSON.stringify({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/uk-who/fictional-child-data');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/uk-who/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/uk-who/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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}}/uk-who/fictional-child-data',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/uk-who/fictional-child-data")
.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/uk-who/fictional-child-data',
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({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/uk-who/fictional-child-data',
headers: {'content-type': 'application/json'},
body: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
},
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}}/uk-who/fictional-child-data');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
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}}/uk-who/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/uk-who/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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 = @{ @"measurement_method": @"",
@"sex": @"",
@"start_chronological_age": @"",
@"end_age": @"",
@"gestation_weeks": @"",
@"gestation_days": @"",
@"measurement_interval_type": @"",
@"measurement_interval_number": @"",
@"start_sds": @"",
@"drift": @NO,
@"drift_range": @"",
@"noise": @NO,
@"noise_range": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/uk-who/fictional-child-data"]
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}}/uk-who/fictional-child-data" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/uk-who/fictional-child-data",
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([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]),
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}}/uk-who/fictional-child-data', [
'body' => '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/uk-who/fictional-child-data');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
$request->setRequestUrl('{{baseUrl}}/uk-who/fictional-child-data');
$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}}/uk-who/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/uk-who/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/uk-who/fictional-child-data", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/uk-who/fictional-child-data"
payload = {
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": False,
"drift_range": "",
"noise": False,
"noise_range": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/uk-who/fictional-child-data"
payload <- "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/uk-who/fictional-child-data")
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/uk-who/fictional-child-data') do |req|
req.body = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/uk-who/fictional-child-data";
let payload = json!({
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
});
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}}/uk-who/fictional-child-data \
--header 'content-type: application/json' \
--data '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
echo '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}' | \
http POST {{baseUrl}}/uk-who/fictional-child-data \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}' \
--output-document \
- {{baseUrl}}/uk-who/fictional-child-data
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/uk-who/fictional-child-data")! 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()
POST
Uk Who Bulk Calculation
{{baseUrl}}/uk-who/bulk-calculation
BODY json
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/uk-who/bulk-calculation");
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/uk-who/bulk-calculation" {:content-type :json
:form-params {:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""
:observations [{:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""}]}})
require "http/client"
url = "{{baseUrl}}/uk-who/bulk-calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/uk-who/bulk-calculation"),
Content = new StringContent("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/uk-who/bulk-calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/uk-who/bulk-calculation"
payload := strings.NewReader("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/uk-who/bulk-calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 366
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/uk-who/bulk-calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/uk-who/bulk-calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/uk-who/bulk-calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/uk-who/bulk-calculation")
.header("content-type", "application/json")
.body("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/uk-who/bulk-calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/uk-who/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/uk-who/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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}}/uk-who/bulk-calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/uk-who/bulk-calculation")
.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/uk-who/bulk-calculation',
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({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/uk-who/bulk-calculation',
headers: {'content-type': 'application/json'},
body: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
},
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}}/uk-who/bulk-calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
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}}/uk-who/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/uk-who/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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 = @{ @"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"",
@"observations": @[ @{ @"observation_date": @"", @"observation_value": @"", @"bone_age": @"", @"bone_age_type": @"", @"bone_age_sds": @"", @"bone_age_centile": @"", @"bone_age_text": @"", @"events_text": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/uk-who/bulk-calculation"]
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}}/uk-who/bulk-calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/uk-who/bulk-calculation",
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([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]),
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}}/uk-who/bulk-calculation', [
'body' => '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/uk-who/bulk-calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/uk-who/bulk-calculation');
$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}}/uk-who/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/uk-who/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/uk-who/bulk-calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/uk-who/bulk-calculation"
payload = {
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/uk-who/bulk-calculation"
payload <- "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/uk-who/bulk-calculation")
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/uk-who/bulk-calculation') do |req|
req.body = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/uk-who/bulk-calculation";
let payload = json!({
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": (
json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
})
)
});
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}}/uk-who/bulk-calculation \
--header 'content-type: application/json' \
--data '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
echo '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}' | \
http POST {{baseUrl}}/uk-who/bulk-calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/uk-who/bulk-calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
[
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/uk-who/bulk-calculation")! 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()
POST
Uk Who Calculation
{{baseUrl}}/uk-who/calculation
BODY json
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/uk-who/calculation");
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/uk-who/calculation" {:content-type :json
:form-params {:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""
:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""}})
require "http/client"
url = "{{baseUrl}}/uk-who/calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/uk-who/calculation"),
Content = new StringContent("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/uk-who/calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/uk-who/calculation"
payload := strings.NewReader("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/uk-who/calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 298
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/uk-who/calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/uk-who/calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/uk-who/calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/uk-who/calculation")
.header("content-type", "application/json")
.body("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.asString();
const data = JSON.stringify({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/uk-who/calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/uk-who/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/uk-who/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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}}/uk-who/calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/uk-who/calculation")
.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/uk-who/calculation',
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({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/uk-who/calculation',
headers: {'content-type': 'application/json'},
body: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
},
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}}/uk-who/calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
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}}/uk-who/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/uk-who/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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 = @{ @"observation_date": @"",
@"observation_value": @"",
@"bone_age": @"",
@"bone_age_type": @"",
@"bone_age_sds": @"",
@"bone_age_centile": @"",
@"bone_age_text": @"",
@"events_text": @"",
@"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/uk-who/calculation"]
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}}/uk-who/calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/uk-who/calculation",
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([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]),
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}}/uk-who/calculation', [
'body' => '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/uk-who/calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
$request->setRequestUrl('{{baseUrl}}/uk-who/calculation');
$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}}/uk-who/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/uk-who/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/uk-who/calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/uk-who/calculation"
payload = {
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/uk-who/calculation"
payload <- "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/uk-who/calculation")
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/uk-who/calculation') do |req|
req.body = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/uk-who/calculation";
let payload = json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
});
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}}/uk-who/calculation \
--header 'content-type: application/json' \
--data '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
echo '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}' | \
http POST {{baseUrl}}/uk-who/calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}' \
--output-document \
- {{baseUrl}}/uk-who/calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/uk-who/calculation")! 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()
POST
Uk Who Chart Coordinates
{{baseUrl}}/uk-who/chart-coordinates
BODY json
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/uk-who/chart-coordinates");
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/uk-who/chart-coordinates" {:content-type :json
:form-params {:sex ""
:measurement_method ""
:is_sds false
:centile_format ""}})
require "http/client"
url = "{{baseUrl}}/uk-who/chart-coordinates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/uk-who/chart-coordinates"),
Content = new StringContent("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/uk-who/chart-coordinates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/uk-who/chart-coordinates"
payload := strings.NewReader("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/uk-who/chart-coordinates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 86
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/uk-who/chart-coordinates")
.setHeader("content-type", "application/json")
.setBody("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/uk-who/chart-coordinates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/uk-who/chart-coordinates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/uk-who/chart-coordinates")
.header("content-type", "application/json")
.body("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.asString();
const data = JSON.stringify({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/uk-who/chart-coordinates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/uk-who/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/uk-who/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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}}/uk-who/chart-coordinates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/uk-who/chart-coordinates")
.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/uk-who/chart-coordinates',
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({sex: '', measurement_method: '', is_sds: false, centile_format: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/uk-who/chart-coordinates',
headers: {'content-type': 'application/json'},
body: {sex: '', measurement_method: '', is_sds: false, centile_format: ''},
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}}/uk-who/chart-coordinates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
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}}/uk-who/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/uk-who/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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 = @{ @"sex": @"",
@"measurement_method": @"",
@"is_sds": @NO,
@"centile_format": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/uk-who/chart-coordinates"]
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}}/uk-who/chart-coordinates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/uk-who/chart-coordinates",
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([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]),
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}}/uk-who/chart-coordinates', [
'body' => '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/uk-who/chart-coordinates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
$request->setRequestUrl('{{baseUrl}}/uk-who/chart-coordinates');
$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}}/uk-who/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/uk-who/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/uk-who/chart-coordinates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/uk-who/chart-coordinates"
payload = {
"sex": "",
"measurement_method": "",
"is_sds": False,
"centile_format": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/uk-who/chart-coordinates"
payload <- "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/uk-who/chart-coordinates")
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/uk-who/chart-coordinates') do |req|
req.body = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/uk-who/chart-coordinates";
let payload = json!({
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
});
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}}/uk-who/chart-coordinates \
--header 'content-type: application/json' \
--data '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
echo '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}' | \
http POST {{baseUrl}}/uk-who/chart-coordinates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}' \
--output-document \
- {{baseUrl}}/uk-who/chart-coordinates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/uk-who/chart-coordinates")! 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()
POST
Mid Parental Height Endpoint
{{baseUrl}}/utilities/mid-parental-height
BODY json
{
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/utilities/mid-parental-height");
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 \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/utilities/mid-parental-height" {:content-type :json
:form-params {:height_paternal ""
:height_maternal ""
:sex ""
:reference ""}})
require "http/client"
url = "{{baseUrl}}/utilities/mid-parental-height"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\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}}/utilities/mid-parental-height"),
Content = new StringContent("{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\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}}/utilities/mid-parental-height");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/utilities/mid-parental-height"
payload := strings.NewReader("{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\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/utilities/mid-parental-height HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 84
{
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/utilities/mid-parental-height")
.setHeader("content-type", "application/json")
.setBody("{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/utilities/mid-parental-height"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\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 \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/utilities/mid-parental-height")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/utilities/mid-parental-height")
.header("content-type", "application/json")
.body("{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\n}")
.asString();
const data = JSON.stringify({
height_paternal: '',
height_maternal: '',
sex: '',
reference: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/utilities/mid-parental-height');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/utilities/mid-parental-height',
headers: {'content-type': 'application/json'},
data: {height_paternal: '', height_maternal: '', sex: '', reference: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/utilities/mid-parental-height';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"height_paternal":"","height_maternal":"","sex":"","reference":""}'
};
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}}/utilities/mid-parental-height',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "height_paternal": "",\n "height_maternal": "",\n "sex": "",\n "reference": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/utilities/mid-parental-height")
.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/utilities/mid-parental-height',
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({height_paternal: '', height_maternal: '', sex: '', reference: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/utilities/mid-parental-height',
headers: {'content-type': 'application/json'},
body: {height_paternal: '', height_maternal: '', sex: '', reference: ''},
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}}/utilities/mid-parental-height');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
height_paternal: '',
height_maternal: '',
sex: '',
reference: ''
});
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}}/utilities/mid-parental-height',
headers: {'content-type': 'application/json'},
data: {height_paternal: '', height_maternal: '', sex: '', reference: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/utilities/mid-parental-height';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"height_paternal":"","height_maternal":"","sex":"","reference":""}'
};
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 = @{ @"height_paternal": @"",
@"height_maternal": @"",
@"sex": @"",
@"reference": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/utilities/mid-parental-height"]
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}}/utilities/mid-parental-height" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/utilities/mid-parental-height",
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([
'height_paternal' => '',
'height_maternal' => '',
'sex' => '',
'reference' => ''
]),
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}}/utilities/mid-parental-height', [
'body' => '{
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/utilities/mid-parental-height');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'height_paternal' => '',
'height_maternal' => '',
'sex' => '',
'reference' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'height_paternal' => '',
'height_maternal' => '',
'sex' => '',
'reference' => ''
]));
$request->setRequestUrl('{{baseUrl}}/utilities/mid-parental-height');
$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}}/utilities/mid-parental-height' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/utilities/mid-parental-height' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/utilities/mid-parental-height", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/utilities/mid-parental-height"
payload = {
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/utilities/mid-parental-height"
payload <- "{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\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}}/utilities/mid-parental-height")
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 \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\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/utilities/mid-parental-height') do |req|
req.body = "{\n \"height_paternal\": \"\",\n \"height_maternal\": \"\",\n \"sex\": \"\",\n \"reference\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/utilities/mid-parental-height";
let payload = json!({
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
});
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}}/utilities/mid-parental-height \
--header 'content-type: application/json' \
--data '{
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
}'
echo '{
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
}' | \
http POST {{baseUrl}}/utilities/mid-parental-height \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "height_paternal": "",\n "height_maternal": "",\n "sex": "",\n "reference": ""\n}' \
--output-document \
- {{baseUrl}}/utilities/mid-parental-height
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"height_paternal": "",
"height_maternal": "",
"sex": "",
"reference": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/utilities/mid-parental-height")! 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()
POST
Fictional Child Data (4)
{{baseUrl}}/who/fictional-child-data
BODY json
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/who/fictional-child-data");
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/who/fictional-child-data" {:content-type :json
:form-params {:measurement_method ""
:sex ""
:start_chronological_age ""
:end_age ""
:gestation_weeks ""
:gestation_days ""
:measurement_interval_type ""
:measurement_interval_number ""
:start_sds ""
:drift false
:drift_range ""
:noise false
:noise_range ""}})
require "http/client"
url = "{{baseUrl}}/who/fictional-child-data"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/who/fictional-child-data"),
Content = new StringContent("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/who/fictional-child-data");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/who/fictional-child-data"
payload := strings.NewReader("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/who/fictional-child-data HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 311
{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/who/fictional-child-data")
.setHeader("content-type", "application/json")
.setBody("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/who/fictional-child-data"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/who/fictional-child-data")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/who/fictional-child-data")
.header("content-type", "application/json")
.body("{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
.asString();
const data = JSON.stringify({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/who/fictional-child-data');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/who/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/who/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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}}/who/fictional-child-data',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/who/fictional-child-data")
.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/who/fictional-child-data',
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({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/who/fictional-child-data',
headers: {'content-type': 'application/json'},
body: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
},
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}}/who/fictional-child-data');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
});
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}}/who/fictional-child-data',
headers: {'content-type': 'application/json'},
data: {
measurement_method: '',
sex: '',
start_chronological_age: '',
end_age: '',
gestation_weeks: '',
gestation_days: '',
measurement_interval_type: '',
measurement_interval_number: '',
start_sds: '',
drift: false,
drift_range: '',
noise: false,
noise_range: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/who/fictional-child-data';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"measurement_method":"","sex":"","start_chronological_age":"","end_age":"","gestation_weeks":"","gestation_days":"","measurement_interval_type":"","measurement_interval_number":"","start_sds":"","drift":false,"drift_range":"","noise":false,"noise_range":""}'
};
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 = @{ @"measurement_method": @"",
@"sex": @"",
@"start_chronological_age": @"",
@"end_age": @"",
@"gestation_weeks": @"",
@"gestation_days": @"",
@"measurement_interval_type": @"",
@"measurement_interval_number": @"",
@"start_sds": @"",
@"drift": @NO,
@"drift_range": @"",
@"noise": @NO,
@"noise_range": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/who/fictional-child-data"]
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}}/who/fictional-child-data" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/who/fictional-child-data",
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([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]),
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}}/who/fictional-child-data', [
'body' => '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/who/fictional-child-data');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'measurement_method' => '',
'sex' => '',
'start_chronological_age' => '',
'end_age' => '',
'gestation_weeks' => '',
'gestation_days' => '',
'measurement_interval_type' => '',
'measurement_interval_number' => '',
'start_sds' => '',
'drift' => null,
'drift_range' => '',
'noise' => null,
'noise_range' => ''
]));
$request->setRequestUrl('{{baseUrl}}/who/fictional-child-data');
$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}}/who/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/who/fictional-child-data' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/who/fictional-child-data", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/who/fictional-child-data"
payload = {
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": False,
"drift_range": "",
"noise": False,
"noise_range": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/who/fictional-child-data"
payload <- "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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}}/who/fictional-child-data")
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 \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\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/who/fictional-child-data') do |req|
req.body = "{\n \"measurement_method\": \"\",\n \"sex\": \"\",\n \"start_chronological_age\": \"\",\n \"end_age\": \"\",\n \"gestation_weeks\": \"\",\n \"gestation_days\": \"\",\n \"measurement_interval_type\": \"\",\n \"measurement_interval_number\": \"\",\n \"start_sds\": \"\",\n \"drift\": false,\n \"drift_range\": \"\",\n \"noise\": false,\n \"noise_range\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/who/fictional-child-data";
let payload = json!({
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
});
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}}/who/fictional-child-data \
--header 'content-type: application/json' \
--data '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}'
echo '{
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
}' | \
http POST {{baseUrl}}/who/fictional-child-data \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "measurement_method": "",\n "sex": "",\n "start_chronological_age": "",\n "end_age": "",\n "gestation_weeks": "",\n "gestation_days": "",\n "measurement_interval_type": "",\n "measurement_interval_number": "",\n "start_sds": "",\n "drift": false,\n "drift_range": "",\n "noise": false,\n "noise_range": ""\n}' \
--output-document \
- {{baseUrl}}/who/fictional-child-data
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"measurement_method": "",
"sex": "",
"start_chronological_age": "",
"end_age": "",
"gestation_weeks": "",
"gestation_days": "",
"measurement_interval_type": "",
"measurement_interval_number": "",
"start_sds": "",
"drift": false,
"drift_range": "",
"noise": false,
"noise_range": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/who/fictional-child-data")! 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()
POST
Who Bulk Calculation
{{baseUrl}}/who/bulk-calculation
BODY json
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/who/bulk-calculation");
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/who/bulk-calculation" {:content-type :json
:form-params {:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""
:observations [{:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""}]}})
require "http/client"
url = "{{baseUrl}}/who/bulk-calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/who/bulk-calculation"),
Content = new StringContent("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/who/bulk-calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/who/bulk-calculation"
payload := strings.NewReader("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/who/bulk-calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 366
{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/who/bulk-calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/who/bulk-calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/who/bulk-calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/who/bulk-calculation")
.header("content-type", "application/json")
.body("{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/who/bulk-calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/who/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/who/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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}}/who/bulk-calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/who/bulk-calculation")
.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/who/bulk-calculation',
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({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/who/bulk-calculation',
headers: {'content-type': 'application/json'},
body: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
},
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}}/who/bulk-calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
});
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}}/who/bulk-calculation',
headers: {'content-type': 'application/json'},
data: {
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: '',
observations: [
{
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/who/bulk-calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":"","observations":[{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":""}]}'
};
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 = @{ @"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"",
@"observations": @[ @{ @"observation_date": @"", @"observation_value": @"", @"bone_age": @"", @"bone_age_type": @"", @"bone_age_sds": @"", @"bone_age_centile": @"", @"bone_age_text": @"", @"events_text": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/who/bulk-calculation"]
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}}/who/bulk-calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/who/bulk-calculation",
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([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]),
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}}/who/bulk-calculation', [
'body' => '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/who/bulk-calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => '',
'observations' => [
[
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/who/bulk-calculation');
$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}}/who/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/who/bulk-calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/who/bulk-calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/who/bulk-calculation"
payload = {
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/who/bulk-calculation"
payload <- "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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}}/who/bulk-calculation")
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 \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\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/who/bulk-calculation') do |req|
req.body = "{\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\",\n \"observations\": [\n {\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/who/bulk-calculation";
let payload = json!({
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": (
json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
})
)
});
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}}/who/bulk-calculation \
--header 'content-type: application/json' \
--data '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}'
echo '{
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
}
]
}' | \
http POST {{baseUrl}}/who/bulk-calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": "",\n "observations": [\n {\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/who/bulk-calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": "",
"observations": [
[
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/who/bulk-calculation")! 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()
POST
Who Calculation
{{baseUrl}}/who/calculation
BODY json
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/who/calculation");
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/who/calculation" {:content-type :json
:form-params {:observation_date ""
:observation_value ""
:bone_age ""
:bone_age_type ""
:bone_age_sds ""
:bone_age_centile ""
:bone_age_text ""
:events_text ""
:gestation_days ""
:gestation_weeks ""
:measurement_method ""
:birth_date ""
:sex ""}})
require "http/client"
url = "{{baseUrl}}/who/calculation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/who/calculation"),
Content = new StringContent("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/who/calculation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/who/calculation"
payload := strings.NewReader("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/who/calculation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 298
{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/who/calculation")
.setHeader("content-type", "application/json")
.setBody("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/who/calculation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/who/calculation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/who/calculation")
.header("content-type", "application/json")
.body("{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
.asString();
const data = JSON.stringify({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/who/calculation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/who/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/who/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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}}/who/calculation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/who/calculation")
.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/who/calculation',
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({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/who/calculation',
headers: {'content-type': 'application/json'},
body: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
},
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}}/who/calculation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
});
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}}/who/calculation',
headers: {'content-type': 'application/json'},
data: {
observation_date: '',
observation_value: '',
bone_age: '',
bone_age_type: '',
bone_age_sds: '',
bone_age_centile: '',
bone_age_text: '',
events_text: '',
gestation_days: '',
gestation_weeks: '',
measurement_method: '',
birth_date: '',
sex: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/who/calculation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"observation_date":"","observation_value":"","bone_age":"","bone_age_type":"","bone_age_sds":"","bone_age_centile":"","bone_age_text":"","events_text":"","gestation_days":"","gestation_weeks":"","measurement_method":"","birth_date":"","sex":""}'
};
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 = @{ @"observation_date": @"",
@"observation_value": @"",
@"bone_age": @"",
@"bone_age_type": @"",
@"bone_age_sds": @"",
@"bone_age_centile": @"",
@"bone_age_text": @"",
@"events_text": @"",
@"gestation_days": @"",
@"gestation_weeks": @"",
@"measurement_method": @"",
@"birth_date": @"",
@"sex": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/who/calculation"]
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}}/who/calculation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/who/calculation",
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([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]),
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}}/who/calculation', [
'body' => '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/who/calculation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'observation_date' => '',
'observation_value' => '',
'bone_age' => '',
'bone_age_type' => '',
'bone_age_sds' => '',
'bone_age_centile' => '',
'bone_age_text' => '',
'events_text' => '',
'gestation_days' => '',
'gestation_weeks' => '',
'measurement_method' => '',
'birth_date' => '',
'sex' => ''
]));
$request->setRequestUrl('{{baseUrl}}/who/calculation');
$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}}/who/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/who/calculation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/who/calculation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/who/calculation"
payload = {
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/who/calculation"
payload <- "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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}}/who/calculation")
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 \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\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/who/calculation') do |req|
req.body = "{\n \"observation_date\": \"\",\n \"observation_value\": \"\",\n \"bone_age\": \"\",\n \"bone_age_type\": \"\",\n \"bone_age_sds\": \"\",\n \"bone_age_centile\": \"\",\n \"bone_age_text\": \"\",\n \"events_text\": \"\",\n \"gestation_days\": \"\",\n \"gestation_weeks\": \"\",\n \"measurement_method\": \"\",\n \"birth_date\": \"\",\n \"sex\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/who/calculation";
let payload = json!({
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
});
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}}/who/calculation \
--header 'content-type: application/json' \
--data '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}'
echo '{
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
}' | \
http POST {{baseUrl}}/who/calculation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "observation_date": "",\n "observation_value": "",\n "bone_age": "",\n "bone_age_type": "",\n "bone_age_sds": "",\n "bone_age_centile": "",\n "bone_age_text": "",\n "events_text": "",\n "gestation_days": "",\n "gestation_weeks": "",\n "measurement_method": "",\n "birth_date": "",\n "sex": ""\n}' \
--output-document \
- {{baseUrl}}/who/calculation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"observation_date": "",
"observation_value": "",
"bone_age": "",
"bone_age_type": "",
"bone_age_sds": "",
"bone_age_centile": "",
"bone_age_text": "",
"events_text": "",
"gestation_days": "",
"gestation_weeks": "",
"measurement_method": "",
"birth_date": "",
"sex": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/who/calculation")! 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()
POST
Who Chart Coordinates
{{baseUrl}}/who/chart-coordinates
BODY json
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/who/chart-coordinates");
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/who/chart-coordinates" {:content-type :json
:form-params {:sex ""
:measurement_method ""
:is_sds false
:centile_format ""}})
require "http/client"
url = "{{baseUrl}}/who/chart-coordinates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/who/chart-coordinates"),
Content = new StringContent("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/who/chart-coordinates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/who/chart-coordinates"
payload := strings.NewReader("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/who/chart-coordinates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 86
{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/who/chart-coordinates")
.setHeader("content-type", "application/json")
.setBody("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/who/chart-coordinates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/who/chart-coordinates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/who/chart-coordinates")
.header("content-type", "application/json")
.body("{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
.asString();
const data = JSON.stringify({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/who/chart-coordinates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/who/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/who/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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}}/who/chart-coordinates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/who/chart-coordinates")
.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/who/chart-coordinates',
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({sex: '', measurement_method: '', is_sds: false, centile_format: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/who/chart-coordinates',
headers: {'content-type': 'application/json'},
body: {sex: '', measurement_method: '', is_sds: false, centile_format: ''},
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}}/who/chart-coordinates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sex: '',
measurement_method: '',
is_sds: false,
centile_format: ''
});
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}}/who/chart-coordinates',
headers: {'content-type': 'application/json'},
data: {sex: '', measurement_method: '', is_sds: false, centile_format: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/who/chart-coordinates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sex":"","measurement_method":"","is_sds":false,"centile_format":""}'
};
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 = @{ @"sex": @"",
@"measurement_method": @"",
@"is_sds": @NO,
@"centile_format": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/who/chart-coordinates"]
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}}/who/chart-coordinates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/who/chart-coordinates",
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([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]),
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}}/who/chart-coordinates', [
'body' => '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/who/chart-coordinates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sex' => '',
'measurement_method' => '',
'is_sds' => null,
'centile_format' => ''
]));
$request->setRequestUrl('{{baseUrl}}/who/chart-coordinates');
$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}}/who/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/who/chart-coordinates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/who/chart-coordinates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/who/chart-coordinates"
payload = {
"sex": "",
"measurement_method": "",
"is_sds": False,
"centile_format": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/who/chart-coordinates"
payload <- "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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}}/who/chart-coordinates")
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 \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\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/who/chart-coordinates') do |req|
req.body = "{\n \"sex\": \"\",\n \"measurement_method\": \"\",\n \"is_sds\": false,\n \"centile_format\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/who/chart-coordinates";
let payload = json!({
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
});
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}}/who/chart-coordinates \
--header 'content-type: application/json' \
--data '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}'
echo '{
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
}' | \
http POST {{baseUrl}}/who/chart-coordinates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sex": "",\n "measurement_method": "",\n "is_sds": false,\n "centile_format": ""\n}' \
--output-document \
- {{baseUrl}}/who/chart-coordinates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sex": "",
"measurement_method": "",
"is_sds": false,
"centile_format": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/who/chart-coordinates")! 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()