VOICEVOX ENGINE OSS
POST
歌唱音声合成用のクエリを作成する
{{baseUrl}}/sing_frame_audio_query
QUERY PARAMS
speaker
BODY json
{
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/sing_frame_audio_query?speaker=");
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 \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/sing_frame_audio_query" {:query-params {:speaker ""}
:content-type :json
:form-params {:notes [{:id ""
:key 0
:frame_length 0
:lyric ""}]}})
require "http/client"
url = "{{baseUrl}}/sing_frame_audio_query?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\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}}/sing_frame_audio_query?speaker="),
Content = new StringContent("{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\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}}/sing_frame_audio_query?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/sing_frame_audio_query?speaker="
payload := strings.NewReader("{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\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/sing_frame_audio_query?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 107
{
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/sing_frame_audio_query?speaker=")
.setHeader("content-type", "application/json")
.setBody("{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/sing_frame_audio_query?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\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 \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/sing_frame_audio_query?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/sing_frame_audio_query?speaker=")
.header("content-type", "application/json")
.body("{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
notes: [
{
id: '',
key: 0,
frame_length: 0,
lyric: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/sing_frame_audio_query?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/sing_frame_audio_query',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/sing_frame_audio_query?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"notes":[{"id":"","key":0,"frame_length":0,"lyric":""}]}'
};
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}}/sing_frame_audio_query?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "notes": [\n {\n "id": "",\n "key": 0,\n "frame_length": 0,\n "lyric": ""\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 \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/sing_frame_audio_query?speaker=")
.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/sing_frame_audio_query?speaker=',
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({notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/sing_frame_audio_query',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]},
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}}/sing_frame_audio_query');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
notes: [
{
id: '',
key: 0,
frame_length: 0,
lyric: ''
}
]
});
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}}/sing_frame_audio_query',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/sing_frame_audio_query?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"notes":[{"id":"","key":0,"frame_length":0,"lyric":""}]}'
};
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 = @{ @"notes": @[ @{ @"id": @"", @"key": @0, @"frame_length": @0, @"lyric": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/sing_frame_audio_query?speaker="]
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}}/sing_frame_audio_query?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/sing_frame_audio_query?speaker=",
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([
'notes' => [
[
'id' => '',
'key' => 0,
'frame_length' => 0,
'lyric' => ''
]
]
]),
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}}/sing_frame_audio_query?speaker=', [
'body' => '{
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/sing_frame_audio_query');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'notes' => [
[
'id' => '',
'key' => 0,
'frame_length' => 0,
'lyric' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'notes' => [
[
'id' => '',
'key' => 0,
'frame_length' => 0,
'lyric' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/sing_frame_audio_query');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/sing_frame_audio_query?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/sing_frame_audio_query?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/sing_frame_audio_query?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/sing_frame_audio_query"
querystring = {"speaker":""}
payload = { "notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/sing_frame_audio_query"
queryString <- list(speaker = "")
payload <- "{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/sing_frame_audio_query?speaker=")
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 \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\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/sing_frame_audio_query') do |req|
req.params['speaker'] = ''
req.body = "{\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\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}}/sing_frame_audio_query";
let querystring = [
("speaker", ""),
];
let payload = json!({"notes": (
json!({
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
})
)});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/sing_frame_audio_query?speaker=' \
--header 'content-type: application/json' \
--data '{
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
}'
echo '{
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
}' | \
http POST '{{baseUrl}}/sing_frame_audio_query?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "notes": [\n {\n "id": "",\n "key": 0,\n "frame_length": 0,\n "lyric": ""\n }\n ]\n}' \
--output-document \
- '{{baseUrl}}/sing_frame_audio_query?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["notes": [
[
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/sing_frame_audio_query?speaker=")! 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
音声合成用のクエリをプリセットを用いて作成する
{{baseUrl}}/audio_query_from_preset
QUERY PARAMS
text
preset_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/audio_query_from_preset?text=&preset_id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/audio_query_from_preset" {:query-params {:text ""
:preset_id ""}})
require "http/client"
url = "{{baseUrl}}/audio_query_from_preset?text=&preset_id="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/audio_query_from_preset?text=&preset_id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/audio_query_from_preset?text=&preset_id=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/audio_query_from_preset?text=&preset_id="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/audio_query_from_preset?text=&preset_id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/audio_query_from_preset?text=&preset_id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/audio_query_from_preset?text=&preset_id="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/audio_query_from_preset?text=&preset_id=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/audio_query_from_preset?text=&preset_id=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/audio_query_from_preset?text=&preset_id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/audio_query_from_preset',
params: {text: '', preset_id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/audio_query_from_preset?text=&preset_id=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/audio_query_from_preset?text=&preset_id=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/audio_query_from_preset?text=&preset_id=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/audio_query_from_preset?text=&preset_id=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/audio_query_from_preset',
qs: {text: '', preset_id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/audio_query_from_preset');
req.query({
text: '',
preset_id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/audio_query_from_preset',
params: {text: '', preset_id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/audio_query_from_preset?text=&preset_id=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/audio_query_from_preset?text=&preset_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/audio_query_from_preset?text=&preset_id=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/audio_query_from_preset?text=&preset_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/audio_query_from_preset?text=&preset_id=');
echo $response->getBody();
setUrl('{{baseUrl}}/audio_query_from_preset');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'text' => '',
'preset_id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/audio_query_from_preset');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'text' => '',
'preset_id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/audio_query_from_preset?text=&preset_id=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/audio_query_from_preset?text=&preset_id=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/audio_query_from_preset?text=&preset_id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/audio_query_from_preset"
querystring = {"text":"","preset_id":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/audio_query_from_preset"
queryString <- list(
text = "",
preset_id = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/audio_query_from_preset?text=&preset_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/audio_query_from_preset') do |req|
req.params['text'] = ''
req.params['preset_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/audio_query_from_preset";
let querystring = [
("text", ""),
("preset_id", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/audio_query_from_preset?text=&preset_id='
http POST '{{baseUrl}}/audio_query_from_preset?text=&preset_id='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/audio_query_from_preset?text=&preset_id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/audio_query_from_preset?text=&preset_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
音声合成用のクエリを作成する
{{baseUrl}}/audio_query
QUERY PARAMS
text
speaker
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/audio_query?text=&speaker=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/audio_query" {:query-params {:text ""
:speaker ""}})
require "http/client"
url = "{{baseUrl}}/audio_query?text=&speaker="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/audio_query?text=&speaker="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/audio_query?text=&speaker=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/audio_query?text=&speaker="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/audio_query?text=&speaker= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/audio_query?text=&speaker=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/audio_query?text=&speaker="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/audio_query?text=&speaker=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/audio_query?text=&speaker=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/audio_query?text=&speaker=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/audio_query',
params: {text: '', speaker: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/audio_query?text=&speaker=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/audio_query?text=&speaker=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/audio_query?text=&speaker=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/audio_query?text=&speaker=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/audio_query',
qs: {text: '', speaker: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/audio_query');
req.query({
text: '',
speaker: ''
});
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}}/audio_query',
params: {text: '', speaker: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/audio_query?text=&speaker=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/audio_query?text=&speaker="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/audio_query?text=&speaker=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/audio_query?text=&speaker=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/audio_query?text=&speaker=');
echo $response->getBody();
setUrl('{{baseUrl}}/audio_query');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'text' => '',
'speaker' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/audio_query');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'text' => '',
'speaker' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/audio_query?text=&speaker=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/audio_query?text=&speaker=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/audio_query?text=&speaker=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/audio_query"
querystring = {"text":"","speaker":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/audio_query"
queryString <- list(
text = "",
speaker = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/audio_query?text=&speaker=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/audio_query') do |req|
req.params['text'] = ''
req.params['speaker'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/audio_query";
let querystring = [
("text", ""),
("speaker", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/audio_query?text=&speaker='
http POST '{{baseUrl}}/audio_query?text=&speaker='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/audio_query?text=&speaker='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/audio_query?text=&speaker=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
アクセント句から音素の長さと音高を得る
{{baseUrl}}/mora_data
QUERY PARAMS
speaker
BODY json
[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/mora_data?speaker=");
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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/mora_data" {:query-params {:speaker ""}
:content-type :json
:form-params [{:moras [{:text ""
:consonant ""
:consonant_length ""
:vowel ""
:vowel_length ""
:pitch ""}]
:accent 0
:pause_mora {}
:is_interrogative false}]})
require "http/client"
url = "{{baseUrl}}/mora_data?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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}}/mora_data?speaker="),
Content = new StringContent("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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}}/mora_data?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/mora_data?speaker="
payload := strings.NewReader("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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/mora_data?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 264
[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/mora_data?speaker=")
.setHeader("content-type", "application/json")
.setBody("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/mora_data?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/mora_data?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/mora_data?speaker=")
.header("content-type", "application/json")
.body("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]")
.asString();
const data = JSON.stringify([
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/mora_data?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/mora_data',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/mora_data?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}]'
};
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}}/mora_data?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]")
val request = Request.Builder()
.url("{{baseUrl}}/mora_data?speaker=")
.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/mora_data?speaker=',
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([
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/mora_data',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
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}}/mora_data');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]);
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}}/mora_data',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/mora_data?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}]'
};
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 = @[ @{ @"moras": @[ @{ @"text": @"", @"consonant": @"", @"consonant_length": @"", @"vowel": @"", @"vowel_length": @"", @"pitch": @"" } ], @"accent": @0, @"pause_mora": @{ }, @"is_interrogative": @NO } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/mora_data?speaker="]
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}}/mora_data?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/mora_data?speaker=",
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([
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
]),
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}}/mora_data?speaker=', [
'body' => '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/mora_data');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/mora_data');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/mora_data?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/mora_data?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/mora_data?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/mora_data"
querystring = {"speaker":""}
payload = [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": False
}
]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/mora_data"
queryString <- list(speaker = "")
payload <- "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/mora_data?speaker=")
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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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/mora_data') do |req|
req.params['speaker'] = ''
req.body = "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/mora_data";
let querystring = [
("speaker", ""),
];
let payload = (
json!({
"moras": (
json!({
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
})
),
"accent": 0,
"pause_mora": json!({}),
"is_interrogative": false
})
);
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/mora_data?speaker=' \
--header 'content-type: application/json' \
--data '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]'
echo '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]' | \
http POST '{{baseUrl}}/mora_data?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n]' \
--output-document \
- '{{baseUrl}}/mora_data?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
[
"moras": [
[
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
]
],
"accent": 0,
"pause_mora": [],
"is_interrogative": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/mora_data?speaker=")! 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
アクセント句から音素の長さを得る
{{baseUrl}}/mora_length
QUERY PARAMS
speaker
BODY json
[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/mora_length?speaker=");
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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/mora_length" {:query-params {:speaker ""}
:content-type :json
:form-params [{:moras [{:text ""
:consonant ""
:consonant_length ""
:vowel ""
:vowel_length ""
:pitch ""}]
:accent 0
:pause_mora {}
:is_interrogative false}]})
require "http/client"
url = "{{baseUrl}}/mora_length?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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}}/mora_length?speaker="),
Content = new StringContent("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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}}/mora_length?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/mora_length?speaker="
payload := strings.NewReader("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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/mora_length?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 264
[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/mora_length?speaker=")
.setHeader("content-type", "application/json")
.setBody("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/mora_length?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/mora_length?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/mora_length?speaker=")
.header("content-type", "application/json")
.body("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]")
.asString();
const data = JSON.stringify([
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/mora_length?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/mora_length',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/mora_length?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}]'
};
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}}/mora_length?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]")
val request = Request.Builder()
.url("{{baseUrl}}/mora_length?speaker=")
.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/mora_length?speaker=',
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([
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/mora_length',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
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}}/mora_length');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]);
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}}/mora_length',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/mora_length?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}]'
};
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 = @[ @{ @"moras": @[ @{ @"text": @"", @"consonant": @"", @"consonant_length": @"", @"vowel": @"", @"vowel_length": @"", @"pitch": @"" } ], @"accent": @0, @"pause_mora": @{ }, @"is_interrogative": @NO } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/mora_length?speaker="]
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}}/mora_length?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/mora_length?speaker=",
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([
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
]),
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}}/mora_length?speaker=', [
'body' => '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/mora_length');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/mora_length');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/mora_length?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/mora_length?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/mora_length?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/mora_length"
querystring = {"speaker":""}
payload = [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": False
}
]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/mora_length"
queryString <- list(speaker = "")
payload <- "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/mora_length?speaker=")
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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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/mora_length') do |req|
req.params['speaker'] = ''
req.body = "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/mora_length";
let querystring = [
("speaker", ""),
];
let payload = (
json!({
"moras": (
json!({
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
})
),
"accent": 0,
"pause_mora": json!({}),
"is_interrogative": false
})
);
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/mora_length?speaker=' \
--header 'content-type: application/json' \
--data '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]'
echo '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]' | \
http POST '{{baseUrl}}/mora_length?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n]' \
--output-document \
- '{{baseUrl}}/mora_length?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
[
"moras": [
[
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
]
],
"accent": 0,
"pause_mora": [],
"is_interrogative": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/mora_length?speaker=")! 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
アクセント句から音高を得る
{{baseUrl}}/mora_pitch
QUERY PARAMS
speaker
BODY json
[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/mora_pitch?speaker=");
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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/mora_pitch" {:query-params {:speaker ""}
:content-type :json
:form-params [{:moras [{:text ""
:consonant ""
:consonant_length ""
:vowel ""
:vowel_length ""
:pitch ""}]
:accent 0
:pause_mora {}
:is_interrogative false}]})
require "http/client"
url = "{{baseUrl}}/mora_pitch?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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}}/mora_pitch?speaker="),
Content = new StringContent("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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}}/mora_pitch?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/mora_pitch?speaker="
payload := strings.NewReader("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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/mora_pitch?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 264
[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/mora_pitch?speaker=")
.setHeader("content-type", "application/json")
.setBody("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/mora_pitch?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/mora_pitch?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/mora_pitch?speaker=")
.header("content-type", "application/json")
.body("[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]")
.asString();
const data = JSON.stringify([
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/mora_pitch?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/mora_pitch',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/mora_pitch?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}]'
};
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}}/mora_pitch?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]")
val request = Request.Builder()
.url("{{baseUrl}}/mora_pitch?speaker=")
.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/mora_pitch?speaker=',
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([
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/mora_pitch',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
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}}/mora_pitch');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]);
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}}/mora_pitch',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/mora_pitch?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}]'
};
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 = @[ @{ @"moras": @[ @{ @"text": @"", @"consonant": @"", @"consonant_length": @"", @"vowel": @"", @"vowel_length": @"", @"pitch": @"" } ], @"accent": @0, @"pause_mora": @{ }, @"is_interrogative": @NO } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/mora_pitch?speaker="]
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}}/mora_pitch?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/mora_pitch?speaker=",
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([
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
]),
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}}/mora_pitch?speaker=', [
'body' => '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/mora_pitch');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/mora_pitch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/mora_pitch?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/mora_pitch?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/mora_pitch?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/mora_pitch"
querystring = {"speaker":""}
payload = [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": False
}
]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/mora_pitch"
queryString <- list(speaker = "")
payload <- "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/mora_pitch?speaker=")
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 {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\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/mora_pitch') do |req|
req.params['speaker'] = ''
req.body = "[\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/mora_pitch";
let querystring = [
("speaker", ""),
];
let payload = (
json!({
"moras": (
json!({
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
})
),
"accent": 0,
"pause_mora": json!({}),
"is_interrogative": false
})
);
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/mora_pitch?speaker=' \
--header 'content-type: application/json' \
--data '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]'
echo '[
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
]' | \
http POST '{{baseUrl}}/mora_pitch?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n]' \
--output-document \
- '{{baseUrl}}/mora_pitch?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
[
"moras": [
[
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
]
],
"accent": 0,
"pause_mora": [],
"is_interrogative": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/mora_pitch?speaker=")! 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
テキストからアクセント句を得る
{{baseUrl}}/accent_phrases
QUERY PARAMS
text
speaker
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accent_phrases?text=&speaker=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accent_phrases" {:query-params {:text ""
:speaker ""}})
require "http/client"
url = "{{baseUrl}}/accent_phrases?text=&speaker="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/accent_phrases?text=&speaker="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accent_phrases?text=&speaker=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accent_phrases?text=&speaker="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/accent_phrases?text=&speaker= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accent_phrases?text=&speaker=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accent_phrases?text=&speaker="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accent_phrases?text=&speaker=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accent_phrases?text=&speaker=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accent_phrases?text=&speaker=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accent_phrases',
params: {text: '', speaker: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accent_phrases?text=&speaker=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/accent_phrases?text=&speaker=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accent_phrases?text=&speaker=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accent_phrases?text=&speaker=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accent_phrases',
qs: {text: '', speaker: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/accent_phrases');
req.query({
text: '',
speaker: ''
});
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}}/accent_phrases',
params: {text: '', speaker: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accent_phrases?text=&speaker=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accent_phrases?text=&speaker="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/accent_phrases?text=&speaker=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accent_phrases?text=&speaker=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/accent_phrases?text=&speaker=');
echo $response->getBody();
setUrl('{{baseUrl}}/accent_phrases');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'text' => '',
'speaker' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accent_phrases');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'text' => '',
'speaker' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accent_phrases?text=&speaker=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accent_phrases?text=&speaker=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/accent_phrases?text=&speaker=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accent_phrases"
querystring = {"text":"","speaker":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accent_phrases"
queryString <- list(
text = "",
speaker = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accent_phrases?text=&speaker=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/accent_phrases') do |req|
req.params['text'] = ''
req.params['speaker'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accent_phrases";
let querystring = [
("text", ""),
("speaker", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/accent_phrases?text=&speaker='
http POST '{{baseUrl}}/accent_phrases?text=&speaker='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/accent_phrases?text=&speaker='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accent_phrases?text=&speaker=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
楽譜・歌唱音声合成用のクエリからフレームごとの基本周波数を得る
{{baseUrl}}/sing_frame_f0
QUERY PARAMS
speaker
BODY json
{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/sing_frame_f0?speaker=");
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 \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/sing_frame_f0" {:query-params {:speaker ""}
:content-type :json
:form-params {:score {:notes [{:id ""
:key 0
:frame_length 0
:lyric ""}]}
:frame_audio_query {:f0 []
:volume []
:phonemes [{:phoneme ""
:frame_length 0
:note_id ""}]
:volumeScale ""
:outputSamplingRate 0
:outputStereo false}}})
require "http/client"
url = "{{baseUrl}}/sing_frame_f0?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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}}/sing_frame_f0?speaker="),
Content = new StringContent("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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}}/sing_frame_f0?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/sing_frame_f0?speaker="
payload := strings.NewReader("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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/sing_frame_f0?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 393
{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/sing_frame_f0?speaker=")
.setHeader("content-type", "application/json")
.setBody("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/sing_frame_f0?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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 \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/sing_frame_f0?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/sing_frame_f0?speaker=")
.header("content-type", "application/json")
.body("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}")
.asString();
const data = JSON.stringify({
score: {
notes: [
{
id: '',
key: 0,
frame_length: 0,
lyric: ''
}
]
},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [
{
phoneme: '',
frame_length: 0,
note_id: ''
}
],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/sing_frame_f0?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/sing_frame_f0',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
score: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/sing_frame_f0?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"score":{"notes":[{"id":"","key":0,"frame_length":0,"lyric":""}]},"frame_audio_query":{"f0":[],"volume":[],"phonemes":[{"phoneme":"","frame_length":0,"note_id":""}],"volumeScale":"","outputSamplingRate":0,"outputStereo":false}}'
};
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}}/sing_frame_f0?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "score": {\n "notes": [\n {\n "id": "",\n "key": 0,\n "frame_length": 0,\n "lyric": ""\n }\n ]\n },\n "frame_audio_query": {\n "f0": [],\n "volume": [],\n "phonemes": [\n {\n "phoneme": "",\n "frame_length": 0,\n "note_id": ""\n }\n ],\n "volumeScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false\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 \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/sing_frame_f0?speaker=")
.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/sing_frame_f0?speaker=',
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({
score: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/sing_frame_f0',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: {
score: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
},
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}}/sing_frame_f0');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
score: {
notes: [
{
id: '',
key: 0,
frame_length: 0,
lyric: ''
}
]
},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [
{
phoneme: '',
frame_length: 0,
note_id: ''
}
],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
});
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}}/sing_frame_f0',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
score: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/sing_frame_f0?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"score":{"notes":[{"id":"","key":0,"frame_length":0,"lyric":""}]},"frame_audio_query":{"f0":[],"volume":[],"phonemes":[{"phoneme":"","frame_length":0,"note_id":""}],"volumeScale":"","outputSamplingRate":0,"outputStereo":false}}'
};
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 = @{ @"score": @{ @"notes": @[ @{ @"id": @"", @"key": @0, @"frame_length": @0, @"lyric": @"" } ] },
@"frame_audio_query": @{ @"f0": @[ ], @"volume": @[ ], @"phonemes": @[ @{ @"phoneme": @"", @"frame_length": @0, @"note_id": @"" } ], @"volumeScale": @"", @"outputSamplingRate": @0, @"outputStereo": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/sing_frame_f0?speaker="]
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}}/sing_frame_f0?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/sing_frame_f0?speaker=",
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([
'score' => [
'notes' => [
[
'id' => '',
'key' => 0,
'frame_length' => 0,
'lyric' => ''
]
]
],
'frame_audio_query' => [
'f0' => [
],
'volume' => [
],
'phonemes' => [
[
'phoneme' => '',
'frame_length' => 0,
'note_id' => ''
]
],
'volumeScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null
]
]),
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}}/sing_frame_f0?speaker=', [
'body' => '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/sing_frame_f0');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'score' => [
'notes' => [
[
'id' => '',
'key' => 0,
'frame_length' => 0,
'lyric' => ''
]
]
],
'frame_audio_query' => [
'f0' => [
],
'volume' => [
],
'phonemes' => [
[
'phoneme' => '',
'frame_length' => 0,
'note_id' => ''
]
],
'volumeScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'score' => [
'notes' => [
[
'id' => '',
'key' => 0,
'frame_length' => 0,
'lyric' => ''
]
]
],
'frame_audio_query' => [
'f0' => [
],
'volume' => [
],
'phonemes' => [
[
'phoneme' => '',
'frame_length' => 0,
'note_id' => ''
]
],
'volumeScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/sing_frame_f0');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/sing_frame_f0?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/sing_frame_f0?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/sing_frame_f0?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/sing_frame_f0"
querystring = {"speaker":""}
payload = {
"score": { "notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
] },
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": False
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/sing_frame_f0"
queryString <- list(speaker = "")
payload <- "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/sing_frame_f0?speaker=")
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 \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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/sing_frame_f0') do |req|
req.params['speaker'] = ''
req.body = "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/sing_frame_f0";
let querystring = [
("speaker", ""),
];
let payload = json!({
"score": json!({"notes": (
json!({
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
})
)}),
"frame_audio_query": json!({
"f0": (),
"volume": (),
"phonemes": (
json!({
"phoneme": "",
"frame_length": 0,
"note_id": ""
})
),
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
})
});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/sing_frame_f0?speaker=' \
--header 'content-type: application/json' \
--data '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}'
echo '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}' | \
http POST '{{baseUrl}}/sing_frame_f0?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "score": {\n "notes": [\n {\n "id": "",\n "key": 0,\n "frame_length": 0,\n "lyric": ""\n }\n ]\n },\n "frame_audio_query": {\n "f0": [],\n "volume": [],\n "phonemes": [\n {\n "phoneme": "",\n "frame_length": 0,\n "note_id": ""\n }\n ],\n "volumeScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false\n }\n}' \
--output-document \
- '{{baseUrl}}/sing_frame_f0?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"score": ["notes": [
[
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
]
]],
"frame_audio_query": [
"f0": [],
"volume": [],
"phonemes": [
[
"phoneme": "",
"frame_length": 0,
"note_id": ""
]
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/sing_frame_f0?speaker=")! 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
楽譜・歌唱音声合成用のクエリからフレームごとの音量を得る
{{baseUrl}}/sing_frame_volume
QUERY PARAMS
speaker
BODY json
{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/sing_frame_volume?speaker=");
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 \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/sing_frame_volume" {:query-params {:speaker ""}
:content-type :json
:form-params {:score {:notes [{:id ""
:key 0
:frame_length 0
:lyric ""}]}
:frame_audio_query {:f0 []
:volume []
:phonemes [{:phoneme ""
:frame_length 0
:note_id ""}]
:volumeScale ""
:outputSamplingRate 0
:outputStereo false}}})
require "http/client"
url = "{{baseUrl}}/sing_frame_volume?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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}}/sing_frame_volume?speaker="),
Content = new StringContent("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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}}/sing_frame_volume?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/sing_frame_volume?speaker="
payload := strings.NewReader("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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/sing_frame_volume?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 393
{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/sing_frame_volume?speaker=")
.setHeader("content-type", "application/json")
.setBody("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/sing_frame_volume?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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 \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/sing_frame_volume?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/sing_frame_volume?speaker=")
.header("content-type", "application/json")
.body("{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}")
.asString();
const data = JSON.stringify({
score: {
notes: [
{
id: '',
key: 0,
frame_length: 0,
lyric: ''
}
]
},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [
{
phoneme: '',
frame_length: 0,
note_id: ''
}
],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/sing_frame_volume?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/sing_frame_volume',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
score: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/sing_frame_volume?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"score":{"notes":[{"id":"","key":0,"frame_length":0,"lyric":""}]},"frame_audio_query":{"f0":[],"volume":[],"phonemes":[{"phoneme":"","frame_length":0,"note_id":""}],"volumeScale":"","outputSamplingRate":0,"outputStereo":false}}'
};
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}}/sing_frame_volume?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "score": {\n "notes": [\n {\n "id": "",\n "key": 0,\n "frame_length": 0,\n "lyric": ""\n }\n ]\n },\n "frame_audio_query": {\n "f0": [],\n "volume": [],\n "phonemes": [\n {\n "phoneme": "",\n "frame_length": 0,\n "note_id": ""\n }\n ],\n "volumeScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false\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 \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/sing_frame_volume?speaker=")
.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/sing_frame_volume?speaker=',
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({
score: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/sing_frame_volume',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: {
score: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
},
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}}/sing_frame_volume');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
score: {
notes: [
{
id: '',
key: 0,
frame_length: 0,
lyric: ''
}
]
},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [
{
phoneme: '',
frame_length: 0,
note_id: ''
}
],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
});
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}}/sing_frame_volume',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
score: {notes: [{id: '', key: 0, frame_length: 0, lyric: ''}]},
frame_audio_query: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/sing_frame_volume?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"score":{"notes":[{"id":"","key":0,"frame_length":0,"lyric":""}]},"frame_audio_query":{"f0":[],"volume":[],"phonemes":[{"phoneme":"","frame_length":0,"note_id":""}],"volumeScale":"","outputSamplingRate":0,"outputStereo":false}}'
};
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 = @{ @"score": @{ @"notes": @[ @{ @"id": @"", @"key": @0, @"frame_length": @0, @"lyric": @"" } ] },
@"frame_audio_query": @{ @"f0": @[ ], @"volume": @[ ], @"phonemes": @[ @{ @"phoneme": @"", @"frame_length": @0, @"note_id": @"" } ], @"volumeScale": @"", @"outputSamplingRate": @0, @"outputStereo": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/sing_frame_volume?speaker="]
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}}/sing_frame_volume?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/sing_frame_volume?speaker=",
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([
'score' => [
'notes' => [
[
'id' => '',
'key' => 0,
'frame_length' => 0,
'lyric' => ''
]
]
],
'frame_audio_query' => [
'f0' => [
],
'volume' => [
],
'phonemes' => [
[
'phoneme' => '',
'frame_length' => 0,
'note_id' => ''
]
],
'volumeScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null
]
]),
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}}/sing_frame_volume?speaker=', [
'body' => '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/sing_frame_volume');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'score' => [
'notes' => [
[
'id' => '',
'key' => 0,
'frame_length' => 0,
'lyric' => ''
]
]
],
'frame_audio_query' => [
'f0' => [
],
'volume' => [
],
'phonemes' => [
[
'phoneme' => '',
'frame_length' => 0,
'note_id' => ''
]
],
'volumeScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'score' => [
'notes' => [
[
'id' => '',
'key' => 0,
'frame_length' => 0,
'lyric' => ''
]
]
],
'frame_audio_query' => [
'f0' => [
],
'volume' => [
],
'phonemes' => [
[
'phoneme' => '',
'frame_length' => 0,
'note_id' => ''
]
],
'volumeScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/sing_frame_volume');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/sing_frame_volume?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/sing_frame_volume?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/sing_frame_volume?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/sing_frame_volume"
querystring = {"speaker":""}
payload = {
"score": { "notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
] },
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": False
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/sing_frame_volume"
queryString <- list(speaker = "")
payload <- "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/sing_frame_volume?speaker=")
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 \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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/sing_frame_volume') do |req|
req.params['speaker'] = ''
req.body = "{\n \"score\": {\n \"notes\": [\n {\n \"id\": \"\",\n \"key\": 0,\n \"frame_length\": 0,\n \"lyric\": \"\"\n }\n ]\n },\n \"frame_audio_query\": {\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/sing_frame_volume";
let querystring = [
("speaker", ""),
];
let payload = json!({
"score": json!({"notes": (
json!({
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
})
)}),
"frame_audio_query": json!({
"f0": (),
"volume": (),
"phonemes": (
json!({
"phoneme": "",
"frame_length": 0,
"note_id": ""
})
),
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
})
});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/sing_frame_volume?speaker=' \
--header 'content-type: application/json' \
--data '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}'
echo '{
"score": {
"notes": [
{
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
}
]
},
"frame_audio_query": {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
}' | \
http POST '{{baseUrl}}/sing_frame_volume?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "score": {\n "notes": [\n {\n "id": "",\n "key": 0,\n "frame_length": 0,\n "lyric": ""\n }\n ]\n },\n "frame_audio_query": {\n "f0": [],\n "volume": [],\n "phonemes": [\n {\n "phoneme": "",\n "frame_length": 0,\n "note_id": ""\n }\n ],\n "volumeScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false\n }\n}' \
--output-document \
- '{{baseUrl}}/sing_frame_volume?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"score": ["notes": [
[
"id": "",
"key": 0,
"frame_length": 0,
"lyric": ""
]
]],
"frame_audio_query": [
"f0": [],
"volume": [],
"phonemes": [
[
"phoneme": "",
"frame_length": 0,
"note_id": ""
]
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/sing_frame_volume?speaker=")! 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
Add Preset
{{baseUrl}}/add_preset
BODY json
{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/add_preset");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/add_preset" {:content-type :json
:form-params {:id 0
:name ""
:speaker_uuid ""
:style_id 0
:speedScale ""
:pitchScale ""
:intonationScale ""
:volumeScale ""
:prePhonemeLength ""
:postPhonemeLength ""
:pauseLength ""
:pauseLengthScale ""}})
require "http/client"
url = "{{baseUrl}}/add_preset"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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}}/add_preset"),
Content = new StringContent("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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}}/add_preset");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/add_preset"
payload := strings.NewReader("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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/add_preset HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 252
{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/add_preset")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/add_preset"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/add_preset")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/add_preset")
.header("content-type", "application/json")
.body("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/add_preset');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/add_preset',
headers: {'content-type': 'application/json'},
data: {
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/add_preset';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0,"name":"","speaker_uuid":"","style_id":0,"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":""}'
};
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}}/add_preset',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": 0,\n "name": "",\n "speaker_uuid": "",\n "style_id": 0,\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/add_preset")
.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/add_preset',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/add_preset',
headers: {'content-type': 'application/json'},
body: {
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
},
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}}/add_preset');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
});
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}}/add_preset',
headers: {'content-type': 'application/json'},
data: {
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/add_preset';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0,"name":"","speaker_uuid":"","style_id":0,"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @0,
@"name": @"",
@"speaker_uuid": @"",
@"style_id": @0,
@"speedScale": @"",
@"pitchScale": @"",
@"intonationScale": @"",
@"volumeScale": @"",
@"prePhonemeLength": @"",
@"postPhonemeLength": @"",
@"pauseLength": @"",
@"pauseLengthScale": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/add_preset"]
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}}/add_preset" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/add_preset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 0,
'name' => '',
'speaker_uuid' => '',
'style_id' => 0,
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => ''
]),
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}}/add_preset', [
'body' => '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/add_preset');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => 0,
'name' => '',
'speaker_uuid' => '',
'style_id' => 0,
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => 0,
'name' => '',
'speaker_uuid' => '',
'style_id' => 0,
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => ''
]));
$request->setRequestUrl('{{baseUrl}}/add_preset');
$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}}/add_preset' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/add_preset' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/add_preset", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/add_preset"
payload = {
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/add_preset"
payload <- "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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}}/add_preset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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/add_preset') do |req|
req.body = "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/add_preset";
let payload = json!({
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
});
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}}/add_preset \
--header 'content-type: application/json' \
--data '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}'
echo '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}' | \
http POST {{baseUrl}}/add_preset \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": 0,\n "name": "",\n "speaker_uuid": "",\n "style_id": 0,\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": ""\n}' \
--output-document \
- {{baseUrl}}/add_preset
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/add_preset")! 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
Core Versions
{{baseUrl}}/core_versions
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/core_versions");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/core_versions")
require "http/client"
url = "{{baseUrl}}/core_versions"
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}}/core_versions"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/core_versions");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/core_versions"
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/core_versions HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/core_versions")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/core_versions"))
.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}}/core_versions")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/core_versions")
.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}}/core_versions');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/core_versions'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/core_versions';
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}}/core_versions',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/core_versions")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/core_versions',
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}}/core_versions'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/core_versions');
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}}/core_versions'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/core_versions';
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}}/core_versions"]
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}}/core_versions" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/core_versions",
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}}/core_versions');
echo $response->getBody();
setUrl('{{baseUrl}}/core_versions');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/core_versions');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/core_versions' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/core_versions' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/core_versions")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/core_versions"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/core_versions"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/core_versions")
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/core_versions') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/core_versions";
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}}/core_versions
http GET {{baseUrl}}/core_versions
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/core_versions
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/core_versions")! 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
Delete Preset
{{baseUrl}}/delete_preset
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/delete_preset?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/delete_preset" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/delete_preset?id="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/delete_preset?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/delete_preset?id=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/delete_preset?id="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/delete_preset?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/delete_preset?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/delete_preset?id="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/delete_preset?id=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/delete_preset?id=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/delete_preset?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/delete_preset',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/delete_preset?id=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/delete_preset?id=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/delete_preset?id=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/delete_preset?id=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/delete_preset', qs: {id: ''}};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/delete_preset');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/delete_preset',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/delete_preset?id=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/delete_preset?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/delete_preset?id=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/delete_preset?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/delete_preset?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/delete_preset');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/delete_preset');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/delete_preset?id=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/delete_preset?id=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/delete_preset?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/delete_preset"
querystring = {"id":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/delete_preset"
queryString <- list(id = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/delete_preset?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/delete_preset') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/delete_preset";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/delete_preset?id='
http POST '{{baseUrl}}/delete_preset?id='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/delete_preset?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/delete_preset?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Engine Manifest
{{baseUrl}}/engine_manifest
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/engine_manifest");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/engine_manifest")
require "http/client"
url = "{{baseUrl}}/engine_manifest"
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}}/engine_manifest"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/engine_manifest");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/engine_manifest"
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/engine_manifest HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/engine_manifest")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/engine_manifest"))
.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}}/engine_manifest")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/engine_manifest")
.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}}/engine_manifest');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/engine_manifest'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/engine_manifest';
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}}/engine_manifest',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/engine_manifest")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/engine_manifest',
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}}/engine_manifest'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/engine_manifest');
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}}/engine_manifest'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/engine_manifest';
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}}/engine_manifest"]
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}}/engine_manifest" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/engine_manifest",
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}}/engine_manifest');
echo $response->getBody();
setUrl('{{baseUrl}}/engine_manifest');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/engine_manifest');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/engine_manifest' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/engine_manifest' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/engine_manifest")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/engine_manifest"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/engine_manifest"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/engine_manifest")
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/engine_manifest') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/engine_manifest";
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}}/engine_manifest
http GET {{baseUrl}}/engine_manifest
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/engine_manifest
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/engine_manifest")! 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()
GET
Get Portal Page
{{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()
GET
Get Presets
{{baseUrl}}/presets
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/presets");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/presets")
require "http/client"
url = "{{baseUrl}}/presets"
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}}/presets"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/presets");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/presets"
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/presets HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/presets")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/presets"))
.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}}/presets")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/presets")
.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}}/presets');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/presets'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/presets';
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}}/presets',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/presets")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/presets',
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}}/presets'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/presets');
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}}/presets'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/presets';
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}}/presets"]
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}}/presets" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/presets",
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}}/presets');
echo $response->getBody();
setUrl('{{baseUrl}}/presets');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/presets');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/presets' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/presets' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/presets")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/presets"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/presets"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/presets")
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/presets') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/presets";
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}}/presets
http GET {{baseUrl}}/presets
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/presets
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/presets")! 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
Initialize Speaker
{{baseUrl}}/initialize_speaker
QUERY PARAMS
speaker
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/initialize_speaker?speaker=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/initialize_speaker" {:query-params {:speaker ""}})
require "http/client"
url = "{{baseUrl}}/initialize_speaker?speaker="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/initialize_speaker?speaker="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/initialize_speaker?speaker=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/initialize_speaker?speaker="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/initialize_speaker?speaker= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/initialize_speaker?speaker=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/initialize_speaker?speaker="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/initialize_speaker?speaker=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/initialize_speaker?speaker=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/initialize_speaker?speaker=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/initialize_speaker',
params: {speaker: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/initialize_speaker?speaker=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/initialize_speaker?speaker=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/initialize_speaker?speaker=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/initialize_speaker?speaker=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/initialize_speaker',
qs: {speaker: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/initialize_speaker');
req.query({
speaker: ''
});
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}}/initialize_speaker',
params: {speaker: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/initialize_speaker?speaker=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/initialize_speaker?speaker="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/initialize_speaker?speaker=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/initialize_speaker?speaker=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/initialize_speaker?speaker=');
echo $response->getBody();
setUrl('{{baseUrl}}/initialize_speaker');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/initialize_speaker');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/initialize_speaker?speaker=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/initialize_speaker?speaker=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/initialize_speaker?speaker=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/initialize_speaker"
querystring = {"speaker":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/initialize_speaker"
queryString <- list(speaker = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/initialize_speaker?speaker=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/initialize_speaker') do |req|
req.params['speaker'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/initialize_speaker";
let querystring = [
("speaker", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/initialize_speaker?speaker='
http POST '{{baseUrl}}/initialize_speaker?speaker='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/initialize_speaker?speaker='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/initialize_speaker?speaker=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Is Initialized Speaker
{{baseUrl}}/is_initialized_speaker
QUERY PARAMS
speaker
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/is_initialized_speaker?speaker=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/is_initialized_speaker" {:query-params {:speaker ""}})
require "http/client"
url = "{{baseUrl}}/is_initialized_speaker?speaker="
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}}/is_initialized_speaker?speaker="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/is_initialized_speaker?speaker=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/is_initialized_speaker?speaker="
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/is_initialized_speaker?speaker= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/is_initialized_speaker?speaker=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/is_initialized_speaker?speaker="))
.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}}/is_initialized_speaker?speaker=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/is_initialized_speaker?speaker=")
.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}}/is_initialized_speaker?speaker=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/is_initialized_speaker',
params: {speaker: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/is_initialized_speaker?speaker=';
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}}/is_initialized_speaker?speaker=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/is_initialized_speaker?speaker=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/is_initialized_speaker?speaker=',
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}}/is_initialized_speaker',
qs: {speaker: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/is_initialized_speaker');
req.query({
speaker: ''
});
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}}/is_initialized_speaker',
params: {speaker: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/is_initialized_speaker?speaker=';
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}}/is_initialized_speaker?speaker="]
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}}/is_initialized_speaker?speaker=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/is_initialized_speaker?speaker=",
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}}/is_initialized_speaker?speaker=');
echo $response->getBody();
setUrl('{{baseUrl}}/is_initialized_speaker');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'speaker' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/is_initialized_speaker');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/is_initialized_speaker?speaker=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/is_initialized_speaker?speaker=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/is_initialized_speaker?speaker=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/is_initialized_speaker"
querystring = {"speaker":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/is_initialized_speaker"
queryString <- list(speaker = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/is_initialized_speaker?speaker=")
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/is_initialized_speaker') do |req|
req.params['speaker'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/is_initialized_speaker";
let querystring = [
("speaker", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/is_initialized_speaker?speaker='
http GET '{{baseUrl}}/is_initialized_speaker?speaker='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/is_initialized_speaker?speaker='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/is_initialized_speaker?speaker=")! 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()
GET
Singer Info
{{baseUrl}}/singer_info
QUERY PARAMS
speaker_uuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/singer_info?speaker_uuid=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/singer_info" {:query-params {:speaker_uuid ""}})
require "http/client"
url = "{{baseUrl}}/singer_info?speaker_uuid="
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}}/singer_info?speaker_uuid="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/singer_info?speaker_uuid=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/singer_info?speaker_uuid="
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/singer_info?speaker_uuid= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/singer_info?speaker_uuid=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/singer_info?speaker_uuid="))
.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}}/singer_info?speaker_uuid=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/singer_info?speaker_uuid=")
.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}}/singer_info?speaker_uuid=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/singer_info',
params: {speaker_uuid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/singer_info?speaker_uuid=';
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}}/singer_info?speaker_uuid=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/singer_info?speaker_uuid=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/singer_info?speaker_uuid=',
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}}/singer_info',
qs: {speaker_uuid: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/singer_info');
req.query({
speaker_uuid: ''
});
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}}/singer_info',
params: {speaker_uuid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/singer_info?speaker_uuid=';
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}}/singer_info?speaker_uuid="]
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}}/singer_info?speaker_uuid=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/singer_info?speaker_uuid=",
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}}/singer_info?speaker_uuid=');
echo $response->getBody();
setUrl('{{baseUrl}}/singer_info');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'speaker_uuid' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/singer_info');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'speaker_uuid' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/singer_info?speaker_uuid=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/singer_info?speaker_uuid=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/singer_info?speaker_uuid=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/singer_info"
querystring = {"speaker_uuid":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/singer_info"
queryString <- list(speaker_uuid = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/singer_info?speaker_uuid=")
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/singer_info') do |req|
req.params['speaker_uuid'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/singer_info";
let querystring = [
("speaker_uuid", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/singer_info?speaker_uuid='
http GET '{{baseUrl}}/singer_info?speaker_uuid='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/singer_info?speaker_uuid='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/singer_info?speaker_uuid=")! 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()
GET
Singers
{{baseUrl}}/singers
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/singers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/singers")
require "http/client"
url = "{{baseUrl}}/singers"
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}}/singers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/singers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/singers"
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/singers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/singers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/singers"))
.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}}/singers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/singers")
.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}}/singers');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/singers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/singers';
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}}/singers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/singers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/singers',
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}}/singers'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/singers');
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}}/singers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/singers';
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}}/singers"]
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}}/singers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/singers",
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}}/singers');
echo $response->getBody();
setUrl('{{baseUrl}}/singers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/singers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/singers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/singers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/singers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/singers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/singers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/singers")
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/singers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/singers";
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}}/singers
http GET {{baseUrl}}/singers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/singers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/singers")! 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()
GET
Speaker Info
{{baseUrl}}/speaker_info
QUERY PARAMS
speaker_uuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/speaker_info?speaker_uuid=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/speaker_info" {:query-params {:speaker_uuid ""}})
require "http/client"
url = "{{baseUrl}}/speaker_info?speaker_uuid="
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}}/speaker_info?speaker_uuid="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/speaker_info?speaker_uuid=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/speaker_info?speaker_uuid="
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/speaker_info?speaker_uuid= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/speaker_info?speaker_uuid=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/speaker_info?speaker_uuid="))
.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}}/speaker_info?speaker_uuid=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/speaker_info?speaker_uuid=")
.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}}/speaker_info?speaker_uuid=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/speaker_info',
params: {speaker_uuid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/speaker_info?speaker_uuid=';
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}}/speaker_info?speaker_uuid=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/speaker_info?speaker_uuid=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/speaker_info?speaker_uuid=',
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}}/speaker_info',
qs: {speaker_uuid: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/speaker_info');
req.query({
speaker_uuid: ''
});
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}}/speaker_info',
params: {speaker_uuid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/speaker_info?speaker_uuid=';
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}}/speaker_info?speaker_uuid="]
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}}/speaker_info?speaker_uuid=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/speaker_info?speaker_uuid=",
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}}/speaker_info?speaker_uuid=');
echo $response->getBody();
setUrl('{{baseUrl}}/speaker_info');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'speaker_uuid' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/speaker_info');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'speaker_uuid' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/speaker_info?speaker_uuid=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/speaker_info?speaker_uuid=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/speaker_info?speaker_uuid=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/speaker_info"
querystring = {"speaker_uuid":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/speaker_info"
queryString <- list(speaker_uuid = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/speaker_info?speaker_uuid=")
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/speaker_info') do |req|
req.params['speaker_uuid'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/speaker_info";
let querystring = [
("speaker_uuid", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/speaker_info?speaker_uuid='
http GET '{{baseUrl}}/speaker_info?speaker_uuid='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/speaker_info?speaker_uuid='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/speaker_info?speaker_uuid=")! 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()
GET
Speakers
{{baseUrl}}/speakers
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/speakers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/speakers")
require "http/client"
url = "{{baseUrl}}/speakers"
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}}/speakers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/speakers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/speakers"
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/speakers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/speakers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/speakers"))
.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}}/speakers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/speakers")
.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}}/speakers');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/speakers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/speakers';
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}}/speakers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/speakers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/speakers',
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}}/speakers'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/speakers');
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}}/speakers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/speakers';
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}}/speakers"]
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}}/speakers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/speakers",
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}}/speakers');
echo $response->getBody();
setUrl('{{baseUrl}}/speakers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/speakers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/speakers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/speakers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/speakers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/speakers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/speakers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/speakers")
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/speakers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/speakers";
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}}/speakers
http GET {{baseUrl}}/speakers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/speakers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/speakers")! 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()
GET
Supported Devices
{{baseUrl}}/supported_devices
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/supported_devices");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/supported_devices")
require "http/client"
url = "{{baseUrl}}/supported_devices"
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}}/supported_devices"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/supported_devices");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/supported_devices"
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/supported_devices HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/supported_devices")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/supported_devices"))
.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}}/supported_devices")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/supported_devices")
.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}}/supported_devices');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/supported_devices'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/supported_devices';
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}}/supported_devices',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/supported_devices")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/supported_devices',
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}}/supported_devices'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/supported_devices');
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}}/supported_devices'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/supported_devices';
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}}/supported_devices"]
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}}/supported_devices" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/supported_devices",
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}}/supported_devices');
echo $response->getBody();
setUrl('{{baseUrl}}/supported_devices');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/supported_devices');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/supported_devices' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/supported_devices' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/supported_devices")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/supported_devices"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/supported_devices"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/supported_devices")
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/supported_devices') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/supported_devices";
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}}/supported_devices
http GET {{baseUrl}}/supported_devices
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/supported_devices
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/supported_devices")! 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
Update Preset
{{baseUrl}}/update_preset
BODY json
{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/update_preset");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/update_preset" {:content-type :json
:form-params {:id 0
:name ""
:speaker_uuid ""
:style_id 0
:speedScale ""
:pitchScale ""
:intonationScale ""
:volumeScale ""
:prePhonemeLength ""
:postPhonemeLength ""
:pauseLength ""
:pauseLengthScale ""}})
require "http/client"
url = "{{baseUrl}}/update_preset"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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}}/update_preset"),
Content = new StringContent("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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}}/update_preset");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/update_preset"
payload := strings.NewReader("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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/update_preset HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 252
{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/update_preset")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/update_preset"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/update_preset")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/update_preset")
.header("content-type", "application/json")
.body("{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/update_preset');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/update_preset',
headers: {'content-type': 'application/json'},
data: {
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/update_preset';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0,"name":"","speaker_uuid":"","style_id":0,"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":""}'
};
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}}/update_preset',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": 0,\n "name": "",\n "speaker_uuid": "",\n "style_id": 0,\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/update_preset")
.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/update_preset',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/update_preset',
headers: {'content-type': 'application/json'},
body: {
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
},
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}}/update_preset');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
});
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}}/update_preset',
headers: {'content-type': 'application/json'},
data: {
id: 0,
name: '',
speaker_uuid: '',
style_id: 0,
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/update_preset';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0,"name":"","speaker_uuid":"","style_id":0,"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @0,
@"name": @"",
@"speaker_uuid": @"",
@"style_id": @0,
@"speedScale": @"",
@"pitchScale": @"",
@"intonationScale": @"",
@"volumeScale": @"",
@"prePhonemeLength": @"",
@"postPhonemeLength": @"",
@"pauseLength": @"",
@"pauseLengthScale": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/update_preset"]
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}}/update_preset" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/update_preset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 0,
'name' => '',
'speaker_uuid' => '',
'style_id' => 0,
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => ''
]),
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}}/update_preset', [
'body' => '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/update_preset');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => 0,
'name' => '',
'speaker_uuid' => '',
'style_id' => 0,
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => 0,
'name' => '',
'speaker_uuid' => '',
'style_id' => 0,
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => ''
]));
$request->setRequestUrl('{{baseUrl}}/update_preset');
$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}}/update_preset' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/update_preset' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/update_preset", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/update_preset"
payload = {
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/update_preset"
payload <- "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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}}/update_preset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\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/update_preset') do |req|
req.body = "{\n \"id\": 0,\n \"name\": \"\",\n \"speaker_uuid\": \"\",\n \"style_id\": 0,\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/update_preset";
let payload = json!({
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
});
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}}/update_preset \
--header 'content-type: application/json' \
--data '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}'
echo '{
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
}' | \
http POST {{baseUrl}}/update_preset \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": 0,\n "name": "",\n "speaker_uuid": "",\n "style_id": 0,\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": ""\n}' \
--output-document \
- {{baseUrl}}/update_preset
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": 0,
"name": "",
"speaker_uuid": "",
"style_id": 0,
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/update_preset")! 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
Version
{{baseUrl}}/version
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/version");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/version")
require "http/client"
url = "{{baseUrl}}/version"
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}}/version"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/version");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/version"
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/version HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/version")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/version"))
.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}}/version")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/version")
.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}}/version');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/version'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/version';
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}}/version',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/version")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/version',
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}}/version'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/version');
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}}/version'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/version';
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}}/version"]
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}}/version" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/version",
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}}/version');
echo $response->getBody();
setUrl('{{baseUrl}}/version');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/version');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/version' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/version' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/version")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/version"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/version"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/version")
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/version') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/version";
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}}/version
http GET {{baseUrl}}/version
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/version
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/version")! 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
base64エンコードされた複数のwavデータを一つに結合する
{{baseUrl}}/connect_waves
BODY json
[
{}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/connect_waves");
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 {}\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/connect_waves" {:content-type :json
:form-params [{}]})
require "http/client"
url = "{{baseUrl}}/connect_waves"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\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}}/connect_waves"),
Content = new StringContent("[\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}}/connect_waves");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {}\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/connect_waves"
payload := strings.NewReader("[\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/connect_waves HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 8
[
{}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/connect_waves")
.setHeader("content-type", "application/json")
.setBody("[\n {}\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/connect_waves"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\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 {}\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/connect_waves")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/connect_waves")
.header("content-type", "application/json")
.body("[\n {}\n]")
.asString();
const data = JSON.stringify([
{}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/connect_waves');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/connect_waves',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/connect_waves';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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}}/connect_waves',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\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 {}\n]")
val request = Request.Builder()
.url("{{baseUrl}}/connect_waves")
.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/connect_waves',
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([{}]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/connect_waves',
headers: {'content-type': 'application/json'},
body: [{}],
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}}/connect_waves');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{}
]);
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}}/connect_waves',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/connect_waves';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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 = @[ @{ } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/connect_waves"]
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}}/connect_waves" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {}\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/connect_waves",
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([
[
]
]),
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}}/connect_waves', [
'body' => '[
{}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/connect_waves');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
]
]));
$request->setRequestUrl('{{baseUrl}}/connect_waves');
$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}}/connect_waves' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/connect_waves' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {}\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/connect_waves", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/connect_waves"
payload = [{}]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/connect_waves"
payload <- "[\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}}/connect_waves")
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 {}\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/connect_waves') do |req|
req.body = "[\n {}\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/connect_waves";
let payload = (json!({}));
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}}/connect_waves \
--header 'content-type: application/json' \
--data '[
{}
]'
echo '[
{}
]' | \
http POST {{baseUrl}}/connect_waves \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {}\n]' \
--output-document \
- {{baseUrl}}/connect_waves
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [[]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/connect_waves")! 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
テキストがAquesTalk 風記法に従っているか判定する
{{baseUrl}}/validate_kana
QUERY PARAMS
text
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/validate_kana?text=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/validate_kana" {:query-params {:text ""}})
require "http/client"
url = "{{baseUrl}}/validate_kana?text="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/validate_kana?text="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/validate_kana?text=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/validate_kana?text="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/validate_kana?text= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/validate_kana?text=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/validate_kana?text="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/validate_kana?text=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/validate_kana?text=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/validate_kana?text=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/validate_kana',
params: {text: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/validate_kana?text=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/validate_kana?text=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/validate_kana?text=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/validate_kana?text=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/validate_kana',
qs: {text: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/validate_kana');
req.query({
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}}/validate_kana',
params: {text: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/validate_kana?text=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/validate_kana?text="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/validate_kana?text=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/validate_kana?text=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/validate_kana?text=');
echo $response->getBody();
setUrl('{{baseUrl}}/validate_kana');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'text' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/validate_kana');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'text' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/validate_kana?text=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/validate_kana?text=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/validate_kana?text=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/validate_kana"
querystring = {"text":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/validate_kana"
queryString <- list(text = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/validate_kana?text=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/validate_kana') do |req|
req.params['text'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/validate_kana";
let querystring = [
("text", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/validate_kana?text='
http POST '{{baseUrl}}/validate_kana?text='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/validate_kana?text='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/validate_kana?text=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Add User Dict Word
{{baseUrl}}/user_dict_word
QUERY PARAMS
surface
pronunciation
accent_type
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/user_dict_word" {:query-params {:surface ""
:pronunciation ""
:accent_type ""}})
require "http/client"
url = "{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/user_dict_word?surface=&pronunciation=&accent_type= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/user_dict_word',
params: {surface: '', pronunciation: '', accent_type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/user_dict_word?surface=&pronunciation=&accent_type=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/user_dict_word',
qs: {surface: '', pronunciation: '', accent_type: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/user_dict_word');
req.query({
surface: '',
pronunciation: '',
accent_type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/user_dict_word',
params: {surface: '', pronunciation: '', accent_type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=');
echo $response->getBody();
setUrl('{{baseUrl}}/user_dict_word');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'surface' => '',
'pronunciation' => '',
'accent_type' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/user_dict_word');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'surface' => '',
'pronunciation' => '',
'accent_type' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/user_dict_word?surface=&pronunciation=&accent_type=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/user_dict_word"
querystring = {"surface":"","pronunciation":"","accent_type":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/user_dict_word"
queryString <- list(
surface = "",
pronunciation = "",
accent_type = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/user_dict_word') do |req|
req.params['surface'] = ''
req.params['pronunciation'] = ''
req.params['accent_type'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/user_dict_word";
let querystring = [
("surface", ""),
("pronunciation", ""),
("accent_type", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type='
http POST '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/user_dict_word?surface=&pronunciation=&accent_type=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete User Dict Word
{{baseUrl}}/user_dict_word/:word_uuid
QUERY PARAMS
word_uuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/user_dict_word/:word_uuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/user_dict_word/:word_uuid")
require "http/client"
url = "{{baseUrl}}/user_dict_word/:word_uuid"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/user_dict_word/:word_uuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/user_dict_word/:word_uuid");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/user_dict_word/:word_uuid"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/user_dict_word/:word_uuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/user_dict_word/:word_uuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/user_dict_word/:word_uuid"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/user_dict_word/:word_uuid")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/user_dict_word/:word_uuid")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/user_dict_word/:word_uuid');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/user_dict_word/:word_uuid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/user_dict_word/:word_uuid';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/user_dict_word/:word_uuid',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/user_dict_word/:word_uuid")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/user_dict_word/:word_uuid',
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: 'DELETE', url: '{{baseUrl}}/user_dict_word/:word_uuid'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/user_dict_word/:word_uuid');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'DELETE', url: '{{baseUrl}}/user_dict_word/:word_uuid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/user_dict_word/:word_uuid';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/user_dict_word/:word_uuid"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/user_dict_word/:word_uuid" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/user_dict_word/:word_uuid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/user_dict_word/:word_uuid');
echo $response->getBody();
setUrl('{{baseUrl}}/user_dict_word/:word_uuid');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/user_dict_word/:word_uuid');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/user_dict_word/:word_uuid' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/user_dict_word/:word_uuid' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/user_dict_word/:word_uuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/user_dict_word/:word_uuid"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/user_dict_word/:word_uuid"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/user_dict_word/:word_uuid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/user_dict_word/:word_uuid') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/user_dict_word/:word_uuid";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/user_dict_word/:word_uuid
http DELETE {{baseUrl}}/user_dict_word/:word_uuid
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/user_dict_word/:word_uuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/user_dict_word/:word_uuid")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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
Get User Dict Words
{{baseUrl}}/user_dict
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/user_dict");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/user_dict")
require "http/client"
url = "{{baseUrl}}/user_dict"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/user_dict"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/user_dict");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/user_dict"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/user_dict HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/user_dict")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/user_dict"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/user_dict")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/user_dict")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/user_dict');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/user_dict'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/user_dict';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/user_dict',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/user_dict")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/user_dict',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/user_dict'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/user_dict');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/user_dict'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/user_dict';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/user_dict"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/user_dict" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/user_dict",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/user_dict');
echo $response->getBody();
setUrl('{{baseUrl}}/user_dict');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/user_dict');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/user_dict' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/user_dict' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/user_dict")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/user_dict"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/user_dict"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/user_dict")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/user_dict') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/user_dict";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/user_dict
http GET {{baseUrl}}/user_dict
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/user_dict
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/user_dict")! 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
Import User Dict Words
{{baseUrl}}/import_user_dict
QUERY PARAMS
override
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/import_user_dict?override=");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/import_user_dict" {:query-params {:override ""}
:content-type :json})
require "http/client"
url = "{{baseUrl}}/import_user_dict?override="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/import_user_dict?override="),
Content = new StringContent("{}")
{
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}}/import_user_dict?override=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/import_user_dict?override="
payload := strings.NewReader("{}")
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/import_user_dict?override= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/import_user_dict?override=")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/import_user_dict?override="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/import_user_dict?override=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/import_user_dict?override=")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/import_user_dict?override=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/import_user_dict',
params: {override: ''},
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/import_user_dict?override=';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/import_user_dict?override=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/import_user_dict?override=")
.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/import_user_dict?override=',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/import_user_dict',
qs: {override: ''},
headers: {'content-type': 'application/json'},
body: {},
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}}/import_user_dict');
req.query({
override: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/import_user_dict',
params: {override: ''},
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/import_user_dict?override=';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/import_user_dict?override="]
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}}/import_user_dict?override=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/import_user_dict?override=",
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([
]),
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}}/import_user_dict?override=', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/import_user_dict');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'override' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/import_user_dict');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'override' => ''
]));
$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}}/import_user_dict?override=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/import_user_dict?override=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/import_user_dict?override=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/import_user_dict"
querystring = {"override":""}
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/import_user_dict"
queryString <- list(override = "")
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/import_user_dict?override=")
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 = "{}"
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/import_user_dict') do |req|
req.params['override'] = ''
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/import_user_dict";
let querystring = [
("override", ""),
];
let payload = json!({});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/import_user_dict?override=' \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST '{{baseUrl}}/import_user_dict?override=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- '{{baseUrl}}/import_user_dict?override='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/import_user_dict?override=")! 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()
PUT
Rewrite User Dict Word
{{baseUrl}}/user_dict_word/:word_uuid
QUERY PARAMS
surface
pronunciation
accent_type
word_uuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/user_dict_word/:word_uuid" {:query-params {:surface ""
:pronunciation ""
:accent_type ""}})
require "http/client"
url = "{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type="
response = HTTP::Client.put url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=");
var request = new RestRequest("", Method.Put);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type="
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type="))
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=")
.put(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/user_dict_word/:word_uuid',
params: {surface: '', pronunciation: '', accent_type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=',
method: 'PUT',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=")
.put(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=',
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: 'PUT',
url: '{{baseUrl}}/user_dict_word/:word_uuid',
qs: {surface: '', pronunciation: '', accent_type: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/user_dict_word/:word_uuid');
req.query({
surface: '',
pronunciation: '',
accent_type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/user_dict_word/:word_uuid',
params: {surface: '', pronunciation: '', accent_type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=" in
Client.call `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=');
echo $response->getBody();
setUrl('{{baseUrl}}/user_dict_word/:word_uuid');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'surface' => '',
'pronunciation' => '',
'accent_type' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/user_dict_word/:word_uuid');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'surface' => '',
'pronunciation' => '',
'accent_type' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=' -Method PUT
$response = Invoke-RestMethod -Uri '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=' -Method PUT
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("PUT", "/baseUrl/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/user_dict_word/:word_uuid"
querystring = {"surface":"","pronunciation":"","accent_type":""}
response = requests.put(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/user_dict_word/:word_uuid"
queryString <- list(
surface = "",
pronunciation = "",
accent_type = ""
)
response <- VERB("PUT", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/user_dict_word/:word_uuid') do |req|
req.params['surface'] = ''
req.params['pronunciation'] = ''
req.params['accent_type'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/user_dict_word/:word_uuid";
let querystring = [
("surface", ""),
("pronunciation", ""),
("accent_type", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type='
http PUT '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type='
wget --quiet \
--method PUT \
--output-document \
- '{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/user_dict_word/:word_uuid?surface=&pronunciation=&accent_type=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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
Setting Get
{{baseUrl}}/setting
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/setting");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/setting")
require "http/client"
url = "{{baseUrl}}/setting"
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}}/setting"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/setting");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/setting"
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/setting HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/setting")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/setting"))
.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}}/setting")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/setting")
.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}}/setting');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/setting'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/setting';
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}}/setting',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/setting")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/setting',
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}}/setting'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/setting');
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}}/setting'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/setting';
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}}/setting"]
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}}/setting" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/setting",
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}}/setting');
echo $response->getBody();
setUrl('{{baseUrl}}/setting');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/setting');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/setting' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/setting' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/setting")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/setting"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/setting"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/setting")
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/setting') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/setting";
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}}/setting
http GET {{baseUrl}}/setting
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/setting
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/setting")! 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
Setting Post
{{baseUrl}}/setting
BODY formUrlEncoded
cors_policy_mode
allow_origin
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/setting");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "cors_policy_mode=&allow_origin=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/setting" {:form-params {:cors_policy_mode ""
:allow_origin ""}})
require "http/client"
url = "{{baseUrl}}/setting"
headers = HTTP::Headers{
"content-type" => "application/x-www-form-urlencoded"
}
reqBody = "cors_policy_mode=&allow_origin="
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}}/setting"),
Content = new FormUrlEncodedContent(new Dictionary
{
{ "cors_policy_mode", "" },
{ "allow_origin", "" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/setting");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "cors_policy_mode=&allow_origin=", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/setting"
payload := strings.NewReader("cors_policy_mode=&allow_origin=")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/setting HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: example.com
Content-Length: 31
cors_policy_mode=&allow_origin=
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/setting")
.setHeader("content-type", "application/x-www-form-urlencoded")
.setBody("cors_policy_mode=&allow_origin=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/setting"))
.header("content-type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("cors_policy_mode=&allow_origin="))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "cors_policy_mode=&allow_origin=");
Request request = new Request.Builder()
.url("{{baseUrl}}/setting")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/setting")
.header("content-type", "application/x-www-form-urlencoded")
.body("cors_policy_mode=&allow_origin=")
.asString();
const data = 'cors_policy_mode=&allow_origin=';
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/setting');
xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
xhr.send(data);
import axios from 'axios';
const encodedParams = new URLSearchParams();
encodedParams.set('cors_policy_mode', '');
encodedParams.set('allow_origin', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/setting',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/setting';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({cors_policy_mode: '', allow_origin: ''})
};
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}}/setting',
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
cors_policy_mode: '',
allow_origin: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/x-www-form-urlencoded")
val body = RequestBody.create(mediaType, "cors_policy_mode=&allow_origin=")
val request = Request.Builder()
.url("{{baseUrl}}/setting")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build()
val response = client.newCall(request).execute()
const qs = require('querystring');
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/setting',
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(qs.stringify({cors_policy_mode: '', allow_origin: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/setting',
headers: {'content-type': 'application/x-www-form-urlencoded'},
form: {cors_policy_mode: '', allow_origin: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/setting');
req.headers({
'content-type': 'application/x-www-form-urlencoded'
});
req.form({
cors_policy_mode: '',
allow_origin: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const { URLSearchParams } = require('url');
const encodedParams = new URLSearchParams();
encodedParams.set('cors_policy_mode', '');
encodedParams.set('allow_origin', '');
const options = {
method: 'POST',
url: '{{baseUrl}}/setting',
headers: {'content-type': 'application/x-www-form-urlencoded'},
data: encodedParams,
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set('cors_policy_mode', '');
encodedParams.set('allow_origin', '');
const url = '{{baseUrl}}/setting';
const options = {
method: 'POST',
headers: {'content-type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/x-www-form-urlencoded" };
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"cors_policy_mode=" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&allow_origin=" dataUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/setting"]
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}}/setting" in
let headers = Header.add (Header.init ()) "content-type" "application/x-www-form-urlencoded" in
let body = Cohttp_lwt_body.of_string "cors_policy_mode=&allow_origin=" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/setting",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "cors_policy_mode=&allow_origin=",
CURLOPT_HTTPHEADER => [
"content-type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/setting', [
'form_params' => [
'cors_policy_mode' => '',
'allow_origin' => ''
],
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/setting');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields([
'cors_policy_mode' => '',
'allow_origin' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(new http\QueryString([
'cors_policy_mode' => '',
'allow_origin' => ''
]));
$request->setRequestUrl('{{baseUrl}}/setting');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/x-www-form-urlencoded'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/setting' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'cors_policy_mode=&allow_origin='
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/setting' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'cors_policy_mode=&allow_origin='
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "cors_policy_mode=&allow_origin="
headers = { 'content-type': "application/x-www-form-urlencoded" }
conn.request("POST", "/baseUrl/setting", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/setting"
payload = {
"cors_policy_mode": "",
"allow_origin": ""
}
headers = {"content-type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/setting"
payload <- "cors_policy_mode=&allow_origin="
encode <- "form"
response <- VERB("POST", url, body = payload, content_type("application/x-www-form-urlencoded"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/setting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "cors_policy_mode=&allow_origin="
response = http.request(request)
puts response.read_body
require 'faraday'
data = {
:cors_policy_mode => "",
:allow_origin => "",
}
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/x-www-form-urlencoded'}
)
response = conn.post('/baseUrl/setting') do |req|
req.body = URI.encode_www_form(data)
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/setting";
let payload = json!({
"cors_policy_mode": "",
"allow_origin": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/x-www-form-urlencoded".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.form(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/setting \
--header 'content-type: application/x-www-form-urlencoded' \
--data cors_policy_mode= \
--data allow_origin=
http --form POST {{baseUrl}}/setting \
content-type:application/x-www-form-urlencoded \
cors_policy_mode='' \
allow_origin=''
wget --quiet \
--method POST \
--header 'content-type: application/x-www-form-urlencoded' \
--body-data 'cors_policy_mode=&allow_origin=' \
--output-document \
- {{baseUrl}}/setting
import Foundation
let headers = ["content-type": "application/x-www-form-urlencoded"]
let postData = NSMutableData(data: "cors_policy_mode=".data(using: String.Encoding.utf8)!)
postData.append("&allow_origin=".data(using: String.Encoding.utf8)!)
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/setting")! 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
Downloadable Libraries
{{baseUrl}}/downloadable_libraries
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/downloadable_libraries");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/downloadable_libraries")
require "http/client"
url = "{{baseUrl}}/downloadable_libraries"
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}}/downloadable_libraries"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/downloadable_libraries");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/downloadable_libraries"
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/downloadable_libraries HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/downloadable_libraries")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/downloadable_libraries"))
.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}}/downloadable_libraries")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/downloadable_libraries")
.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}}/downloadable_libraries');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/downloadable_libraries'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/downloadable_libraries';
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}}/downloadable_libraries',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/downloadable_libraries")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/downloadable_libraries',
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}}/downloadable_libraries'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/downloadable_libraries');
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}}/downloadable_libraries'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/downloadable_libraries';
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}}/downloadable_libraries"]
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}}/downloadable_libraries" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/downloadable_libraries",
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}}/downloadable_libraries');
echo $response->getBody();
setUrl('{{baseUrl}}/downloadable_libraries');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/downloadable_libraries');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/downloadable_libraries' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/downloadable_libraries' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/downloadable_libraries")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/downloadable_libraries"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/downloadable_libraries"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/downloadable_libraries")
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/downloadable_libraries') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/downloadable_libraries";
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}}/downloadable_libraries
http GET {{baseUrl}}/downloadable_libraries
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/downloadable_libraries
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/downloadable_libraries")! 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
Install Library
{{baseUrl}}/install_library/:library_uuid
QUERY PARAMS
library_uuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/install_library/:library_uuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/install_library/:library_uuid")
require "http/client"
url = "{{baseUrl}}/install_library/:library_uuid"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/install_library/:library_uuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/install_library/:library_uuid");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/install_library/:library_uuid"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/install_library/:library_uuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/install_library/:library_uuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/install_library/:library_uuid"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/install_library/:library_uuid")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/install_library/:library_uuid")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/install_library/:library_uuid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/install_library/:library_uuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/install_library/:library_uuid';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/install_library/:library_uuid',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/install_library/:library_uuid")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/install_library/:library_uuid',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/install_library/:library_uuid'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/install_library/:library_uuid');
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}}/install_library/:library_uuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/install_library/:library_uuid';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/install_library/:library_uuid"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/install_library/:library_uuid" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/install_library/:library_uuid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/install_library/:library_uuid');
echo $response->getBody();
setUrl('{{baseUrl}}/install_library/:library_uuid');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/install_library/:library_uuid');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/install_library/:library_uuid' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/install_library/:library_uuid' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/install_library/:library_uuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/install_library/:library_uuid"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/install_library/:library_uuid"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/install_library/:library_uuid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/install_library/:library_uuid') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/install_library/:library_uuid";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/install_library/:library_uuid
http POST {{baseUrl}}/install_library/:library_uuid
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/install_library/:library_uuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/install_library/:library_uuid")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Installed Libraries
{{baseUrl}}/installed_libraries
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/installed_libraries");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/installed_libraries")
require "http/client"
url = "{{baseUrl}}/installed_libraries"
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}}/installed_libraries"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/installed_libraries");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/installed_libraries"
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/installed_libraries HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/installed_libraries")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/installed_libraries"))
.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}}/installed_libraries")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/installed_libraries")
.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}}/installed_libraries');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/installed_libraries'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/installed_libraries';
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}}/installed_libraries',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/installed_libraries")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/installed_libraries',
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}}/installed_libraries'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/installed_libraries');
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}}/installed_libraries'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/installed_libraries';
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}}/installed_libraries"]
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}}/installed_libraries" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/installed_libraries",
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}}/installed_libraries');
echo $response->getBody();
setUrl('{{baseUrl}}/installed_libraries');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/installed_libraries');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/installed_libraries' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/installed_libraries' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/installed_libraries")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/installed_libraries"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/installed_libraries"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/installed_libraries")
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/installed_libraries') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/installed_libraries";
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}}/installed_libraries
http GET {{baseUrl}}/installed_libraries
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/installed_libraries
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/installed_libraries")! 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
Uninstall Library
{{baseUrl}}/uninstall_library/:library_uuid
QUERY PARAMS
library_uuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/uninstall_library/:library_uuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/uninstall_library/:library_uuid")
require "http/client"
url = "{{baseUrl}}/uninstall_library/:library_uuid"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/uninstall_library/:library_uuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/uninstall_library/:library_uuid");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/uninstall_library/:library_uuid"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/uninstall_library/:library_uuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/uninstall_library/:library_uuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/uninstall_library/:library_uuid"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/uninstall_library/:library_uuid")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/uninstall_library/:library_uuid")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/uninstall_library/:library_uuid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/uninstall_library/:library_uuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/uninstall_library/:library_uuid';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/uninstall_library/:library_uuid',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/uninstall_library/:library_uuid")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/uninstall_library/:library_uuid',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/uninstall_library/:library_uuid'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/uninstall_library/:library_uuid');
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}}/uninstall_library/:library_uuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/uninstall_library/:library_uuid';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/uninstall_library/:library_uuid"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/uninstall_library/:library_uuid" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/uninstall_library/:library_uuid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/uninstall_library/:library_uuid');
echo $response->getBody();
setUrl('{{baseUrl}}/uninstall_library/:library_uuid');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/uninstall_library/:library_uuid');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/uninstall_library/:library_uuid' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/uninstall_library/:library_uuid' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/uninstall_library/:library_uuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/uninstall_library/:library_uuid"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/uninstall_library/:library_uuid"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/uninstall_library/:library_uuid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/uninstall_library/:library_uuid') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/uninstall_library/:library_uuid";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/uninstall_library/:library_uuid
http POST {{baseUrl}}/uninstall_library/:library_uuid
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/uninstall_library/:library_uuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/uninstall_library/:library_uuid")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
2種類のスタイルでモーフィングした音声を合成する
{{baseUrl}}/synthesis_morphing
QUERY PARAMS
base_speaker
target_speaker
morph_rate
BODY json
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=");
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 \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/synthesis_morphing" {:query-params {:base_speaker ""
:target_speaker ""
:morph_rate ""}
:content-type :json
:form-params {:accent_phrases [{:moras [{:text ""
:consonant ""
:consonant_length ""
:vowel ""
:vowel_length ""
:pitch ""}]
:accent 0
:pause_mora {}
:is_interrogative false}]
:speedScale ""
:pitchScale ""
:intonationScale ""
:volumeScale ""
:prePhonemeLength ""
:postPhonemeLength ""
:pauseLength ""
:pauseLengthScale ""
:outputSamplingRate 0
:outputStereo false
:kana ""}})
require "http/client"
url = "{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate="),
Content = new StringContent("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate="
payload := strings.NewReader("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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/synthesis_morphing?base_speaker=&target_speaker=&morph_rate= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 572
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=")
.setHeader("content-type", "application/json")
.setBody("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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 \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=")
.header("content-type", "application/json")
.body("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}")
.asString();
const data = JSON.stringify({
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/synthesis_morphing',
params: {base_speaker: '', target_speaker: '', morph_rate: ''},
headers: {'content-type': 'application/json'},
data: {
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accent_phrases":[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}],"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":"","outputSamplingRate":0,"outputStereo":false,"kana":""}'
};
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}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accent_phrases": [\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n ],\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false,\n "kana": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=")
.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/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=',
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({
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/synthesis_morphing',
qs: {base_speaker: '', target_speaker: '', morph_rate: ''},
headers: {'content-type': 'application/json'},
body: {
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
},
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}}/synthesis_morphing');
req.query({
base_speaker: '',
target_speaker: '',
morph_rate: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
});
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}}/synthesis_morphing',
params: {base_speaker: '', target_speaker: '', morph_rate: ''},
headers: {'content-type': 'application/json'},
data: {
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accent_phrases":[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}],"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":"","outputSamplingRate":0,"outputStereo":false,"kana":""}'
};
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 = @{ @"accent_phrases": @[ @{ @"moras": @[ @{ @"text": @"", @"consonant": @"", @"consonant_length": @"", @"vowel": @"", @"vowel_length": @"", @"pitch": @"" } ], @"accent": @0, @"pause_mora": @{ }, @"is_interrogative": @NO } ],
@"speedScale": @"",
@"pitchScale": @"",
@"intonationScale": @"",
@"volumeScale": @"",
@"prePhonemeLength": @"",
@"postPhonemeLength": @"",
@"pauseLength": @"",
@"pauseLengthScale": @"",
@"outputSamplingRate": @0,
@"outputStereo": @NO,
@"kana": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate="]
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}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=",
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([
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]),
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}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=', [
'body' => '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/synthesis_morphing');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'base_speaker' => '',
'target_speaker' => '',
'morph_rate' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]));
$request->setRequestUrl('{{baseUrl}}/synthesis_morphing');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'base_speaker' => '',
'target_speaker' => '',
'morph_rate' => ''
]));
$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}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/synthesis_morphing"
querystring = {"base_speaker":"","target_speaker":"","morph_rate":""}
payload = {
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": False
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": False,
"kana": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/synthesis_morphing"
queryString <- list(
base_speaker = "",
target_speaker = "",
morph_rate = ""
)
payload <- "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=")
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 \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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/synthesis_morphing') do |req|
req.params['base_speaker'] = ''
req.params['target_speaker'] = ''
req.params['morph_rate'] = ''
req.body = "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/synthesis_morphing";
let querystring = [
("base_speaker", ""),
("target_speaker", ""),
("morph_rate", ""),
];
let payload = json!({
"accent_phrases": (
json!({
"moras": (
json!({
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
})
),
"accent": 0,
"pause_mora": json!({}),
"is_interrogative": false
})
),
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=' \
--header 'content-type: application/json' \
--data '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}'
echo '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}' | \
http POST '{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accent_phrases": [\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n ],\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false,\n "kana": ""\n}' \
--output-document \
- '{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accent_phrases": [
[
"moras": [
[
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
]
],
"accent": 0,
"pause_mora": [],
"is_interrogative": false
]
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/synthesis_morphing?base_speaker=&target_speaker=&morph_rate=")! 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
Frame Synthesis
{{baseUrl}}/frame_synthesis
QUERY PARAMS
speaker
BODY json
{
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/frame_synthesis?speaker=");
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 \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/frame_synthesis" {:query-params {:speaker ""}
:content-type :json
:form-params {:f0 []
:volume []
:phonemes [{:phoneme ""
:frame_length 0
:note_id ""}]
:volumeScale ""
:outputSamplingRate 0
:outputStereo false}})
require "http/client"
url = "{{baseUrl}}/frame_synthesis?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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}}/frame_synthesis?speaker="),
Content = new StringContent("{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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}}/frame_synthesis?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/frame_synthesis?speaker="
payload := strings.NewReader("{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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/frame_synthesis?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 202
{
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/frame_synthesis?speaker=")
.setHeader("content-type", "application/json")
.setBody("{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/frame_synthesis?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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 \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/frame_synthesis?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/frame_synthesis?speaker=")
.header("content-type", "application/json")
.body("{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}")
.asString();
const data = JSON.stringify({
f0: [],
volume: [],
phonemes: [
{
phoneme: '',
frame_length: 0,
note_id: ''
}
],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/frame_synthesis?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/frame_synthesis',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/frame_synthesis?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"f0":[],"volume":[],"phonemes":[{"phoneme":"","frame_length":0,"note_id":""}],"volumeScale":"","outputSamplingRate":0,"outputStereo":false}'
};
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}}/frame_synthesis?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "f0": [],\n "volume": [],\n "phonemes": [\n {\n "phoneme": "",\n "frame_length": 0,\n "note_id": ""\n }\n ],\n "volumeScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/frame_synthesis?speaker=")
.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/frame_synthesis?speaker=',
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({
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/frame_synthesis',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
},
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}}/frame_synthesis');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
f0: [],
volume: [],
phonemes: [
{
phoneme: '',
frame_length: 0,
note_id: ''
}
],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
});
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}}/frame_synthesis',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
f0: [],
volume: [],
phonemes: [{phoneme: '', frame_length: 0, note_id: ''}],
volumeScale: '',
outputSamplingRate: 0,
outputStereo: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/frame_synthesis?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"f0":[],"volume":[],"phonemes":[{"phoneme":"","frame_length":0,"note_id":""}],"volumeScale":"","outputSamplingRate":0,"outputStereo":false}'
};
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 = @{ @"f0": @[ ],
@"volume": @[ ],
@"phonemes": @[ @{ @"phoneme": @"", @"frame_length": @0, @"note_id": @"" } ],
@"volumeScale": @"",
@"outputSamplingRate": @0,
@"outputStereo": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/frame_synthesis?speaker="]
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}}/frame_synthesis?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/frame_synthesis?speaker=",
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([
'f0' => [
],
'volume' => [
],
'phonemes' => [
[
'phoneme' => '',
'frame_length' => 0,
'note_id' => ''
]
],
'volumeScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null
]),
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}}/frame_synthesis?speaker=', [
'body' => '{
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/frame_synthesis');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'f0' => [
],
'volume' => [
],
'phonemes' => [
[
'phoneme' => '',
'frame_length' => 0,
'note_id' => ''
]
],
'volumeScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'f0' => [
],
'volume' => [
],
'phonemes' => [
[
'phoneme' => '',
'frame_length' => 0,
'note_id' => ''
]
],
'volumeScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null
]));
$request->setRequestUrl('{{baseUrl}}/frame_synthesis');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/frame_synthesis?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/frame_synthesis?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/frame_synthesis?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/frame_synthesis"
querystring = {"speaker":""}
payload = {
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/frame_synthesis"
queryString <- list(speaker = "")
payload <- "{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/frame_synthesis?speaker=")
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 \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\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/frame_synthesis') do |req|
req.params['speaker'] = ''
req.body = "{\n \"f0\": [],\n \"volume\": [],\n \"phonemes\": [\n {\n \"phoneme\": \"\",\n \"frame_length\": 0,\n \"note_id\": \"\"\n }\n ],\n \"volumeScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/frame_synthesis";
let querystring = [
("speaker", ""),
];
let payload = json!({
"f0": (),
"volume": (),
"phonemes": (
json!({
"phoneme": "",
"frame_length": 0,
"note_id": ""
})
),
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/frame_synthesis?speaker=' \
--header 'content-type: application/json' \
--data '{
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}'
echo '{
"f0": [],
"volume": [],
"phonemes": [
{
"phoneme": "",
"frame_length": 0,
"note_id": ""
}
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
}' | \
http POST '{{baseUrl}}/frame_synthesis?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "f0": [],\n "volume": [],\n "phonemes": [\n {\n "phoneme": "",\n "frame_length": 0,\n "note_id": ""\n }\n ],\n "volumeScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false\n}' \
--output-document \
- '{{baseUrl}}/frame_synthesis?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"f0": [],
"volume": [],
"phonemes": [
[
"phoneme": "",
"frame_length": 0,
"note_id": ""
]
],
"volumeScale": "",
"outputSamplingRate": 0,
"outputStereo": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/frame_synthesis?speaker=")! 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
指定したスタイルに対してエンジン内のキャラクターがモーフィングが可能か判定する
{{baseUrl}}/morphable_targets
BODY json
[
{}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/morphable_targets");
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 {}\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/morphable_targets" {:content-type :json
:form-params [{}]})
require "http/client"
url = "{{baseUrl}}/morphable_targets"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\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}}/morphable_targets"),
Content = new StringContent("[\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}}/morphable_targets");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {}\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/morphable_targets"
payload := strings.NewReader("[\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/morphable_targets HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 8
[
{}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/morphable_targets")
.setHeader("content-type", "application/json")
.setBody("[\n {}\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/morphable_targets"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\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 {}\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/morphable_targets")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/morphable_targets")
.header("content-type", "application/json")
.body("[\n {}\n]")
.asString();
const data = JSON.stringify([
{}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/morphable_targets');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/morphable_targets',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/morphable_targets';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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}}/morphable_targets',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\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 {}\n]")
val request = Request.Builder()
.url("{{baseUrl}}/morphable_targets")
.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/morphable_targets',
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([{}]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/morphable_targets',
headers: {'content-type': 'application/json'},
body: [{}],
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}}/morphable_targets');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{}
]);
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}}/morphable_targets',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/morphable_targets';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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 = @[ @{ } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/morphable_targets"]
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}}/morphable_targets" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {}\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/morphable_targets",
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([
[
]
]),
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}}/morphable_targets', [
'body' => '[
{}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/morphable_targets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
]
]));
$request->setRequestUrl('{{baseUrl}}/morphable_targets');
$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}}/morphable_targets' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/morphable_targets' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {}\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/morphable_targets", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/morphable_targets"
payload = [{}]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/morphable_targets"
payload <- "[\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}}/morphable_targets")
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 {}\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/morphable_targets') do |req|
req.body = "[\n {}\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/morphable_targets";
let payload = (json!({}));
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}}/morphable_targets \
--header 'content-type: application/json' \
--data '[
{}
]'
echo '[
{}
]' | \
http POST {{baseUrl}}/morphable_targets \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {}\n]' \
--output-document \
- {{baseUrl}}/morphable_targets
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [[]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/morphable_targets")! 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
複数まとめて音声合成する
{{baseUrl}}/multi_synthesis
QUERY PARAMS
speaker
BODY json
[
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/multi_synthesis?speaker=");
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 {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/multi_synthesis" {:query-params {:speaker ""}
:content-type :json
:form-params [{:accent_phrases [{:moras [{:text ""
:consonant ""
:consonant_length ""
:vowel ""
:vowel_length ""
:pitch ""}]
:accent 0
:pause_mora {}
:is_interrogative false}]
:speedScale ""
:pitchScale ""
:intonationScale ""
:volumeScale ""
:prePhonemeLength ""
:postPhonemeLength ""
:pauseLength ""
:pauseLengthScale ""
:outputSamplingRate 0
:outputStereo false
:kana ""}]})
require "http/client"
url = "{{baseUrl}}/multi_synthesis?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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}}/multi_synthesis?speaker="),
Content = new StringContent("[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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}}/multi_synthesis?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/multi_synthesis?speaker="
payload := strings.NewReader("[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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/multi_synthesis?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 636
[
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/multi_synthesis?speaker=")
.setHeader("content-type", "application/json")
.setBody("[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/multi_synthesis?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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 {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/multi_synthesis?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/multi_synthesis?speaker=")
.header("content-type", "application/json")
.body("[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]")
.asString();
const data = JSON.stringify([
{
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/multi_synthesis?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/multi_synthesis',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: [
{
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/multi_synthesis?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"accent_phrases":[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}],"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":"","outputSamplingRate":0,"outputStereo":false,"kana":""}]'
};
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}}/multi_synthesis?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\n {\n "accent_phrases": [\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n ],\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false,\n "kana": ""\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 {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]")
val request = Request.Builder()
.url("{{baseUrl}}/multi_synthesis?speaker=")
.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/multi_synthesis?speaker=',
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([
{
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/multi_synthesis',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: [
{
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
],
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}}/multi_synthesis');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
]);
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}}/multi_synthesis',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: [
{
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/multi_synthesis?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"accent_phrases":[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}],"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":"","outputSamplingRate":0,"outputStereo":false,"kana":""}]'
};
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 = @[ @{ @"accent_phrases": @[ @{ @"moras": @[ @{ @"text": @"", @"consonant": @"", @"consonant_length": @"", @"vowel": @"", @"vowel_length": @"", @"pitch": @"" } ], @"accent": @0, @"pause_mora": @{ }, @"is_interrogative": @NO } ], @"speedScale": @"", @"pitchScale": @"", @"intonationScale": @"", @"volumeScale": @"", @"prePhonemeLength": @"", @"postPhonemeLength": @"", @"pauseLength": @"", @"pauseLengthScale": @"", @"outputSamplingRate": @0, @"outputStereo": @NO, @"kana": @"" } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/multi_synthesis?speaker="]
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}}/multi_synthesis?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/multi_synthesis?speaker=",
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([
[
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]
]),
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}}/multi_synthesis?speaker=', [
'body' => '[
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/multi_synthesis');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/multi_synthesis');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/multi_synthesis?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/multi_synthesis?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/multi_synthesis?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/multi_synthesis"
querystring = {"speaker":""}
payload = [
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": False
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": False,
"kana": ""
}
]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/multi_synthesis"
queryString <- list(speaker = "")
payload <- "[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/multi_synthesis?speaker=")
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 {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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/multi_synthesis') do |req|
req.params['speaker'] = ''
req.body = "[\n {\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n }\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/multi_synthesis";
let querystring = [
("speaker", ""),
];
let payload = (
json!({
"accent_phrases": (
json!({
"moras": (
json!({
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
})
),
"accent": 0,
"pause_mora": json!({}),
"is_interrogative": false
})
),
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
})
);
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/multi_synthesis?speaker=' \
--header 'content-type: application/json' \
--data '[
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
]'
echo '[
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
]' | \
http POST '{{baseUrl}}/multi_synthesis?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {\n "accent_phrases": [\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n ],\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false,\n "kana": ""\n }\n]' \
--output-document \
- '{{baseUrl}}/multi_synthesis?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
[
"accent_phrases": [
[
"moras": [
[
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
]
],
"accent": 0,
"pause_mora": [],
"is_interrogative": false
]
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/multi_synthesis?speaker=")! 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
音声合成する
{{baseUrl}}/synthesis
QUERY PARAMS
speaker
BODY json
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/synthesis?speaker=");
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 \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/synthesis" {:query-params {:speaker ""}
:content-type :json
:form-params {:accent_phrases [{:moras [{:text ""
:consonant ""
:consonant_length ""
:vowel ""
:vowel_length ""
:pitch ""}]
:accent 0
:pause_mora {}
:is_interrogative false}]
:speedScale ""
:pitchScale ""
:intonationScale ""
:volumeScale ""
:prePhonemeLength ""
:postPhonemeLength ""
:pauseLength ""
:pauseLengthScale ""
:outputSamplingRate 0
:outputStereo false
:kana ""}})
require "http/client"
url = "{{baseUrl}}/synthesis?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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}}/synthesis?speaker="),
Content = new StringContent("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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}}/synthesis?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/synthesis?speaker="
payload := strings.NewReader("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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/synthesis?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 572
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/synthesis?speaker=")
.setHeader("content-type", "application/json")
.setBody("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/synthesis?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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 \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/synthesis?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/synthesis?speaker=")
.header("content-type", "application/json")
.body("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}")
.asString();
const data = JSON.stringify({
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/synthesis?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/synthesis',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/synthesis?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accent_phrases":[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}],"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":"","outputSamplingRate":0,"outputStereo":false,"kana":""}'
};
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}}/synthesis?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accent_phrases": [\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n ],\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false,\n "kana": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/synthesis?speaker=")
.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/synthesis?speaker=',
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({
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/synthesis',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: {
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
},
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}}/synthesis');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
});
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}}/synthesis',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/synthesis?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accent_phrases":[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}],"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":"","outputSamplingRate":0,"outputStereo":false,"kana":""}'
};
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 = @{ @"accent_phrases": @[ @{ @"moras": @[ @{ @"text": @"", @"consonant": @"", @"consonant_length": @"", @"vowel": @"", @"vowel_length": @"", @"pitch": @"" } ], @"accent": @0, @"pause_mora": @{ }, @"is_interrogative": @NO } ],
@"speedScale": @"",
@"pitchScale": @"",
@"intonationScale": @"",
@"volumeScale": @"",
@"prePhonemeLength": @"",
@"postPhonemeLength": @"",
@"pauseLength": @"",
@"pauseLengthScale": @"",
@"outputSamplingRate": @0,
@"outputStereo": @NO,
@"kana": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/synthesis?speaker="]
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}}/synthesis?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/synthesis?speaker=",
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([
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]),
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}}/synthesis?speaker=', [
'body' => '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/synthesis');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]));
$request->setRequestUrl('{{baseUrl}}/synthesis');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/synthesis?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/synthesis?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/synthesis?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/synthesis"
querystring = {"speaker":""}
payload = {
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": False
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": False,
"kana": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/synthesis"
queryString <- list(speaker = "")
payload <- "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/synthesis?speaker=")
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 \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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/synthesis') do |req|
req.params['speaker'] = ''
req.body = "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/synthesis";
let querystring = [
("speaker", ""),
];
let payload = json!({
"accent_phrases": (
json!({
"moras": (
json!({
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
})
),
"accent": 0,
"pause_mora": json!({}),
"is_interrogative": false
})
),
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/synthesis?speaker=' \
--header 'content-type: application/json' \
--data '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}'
echo '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}' | \
http POST '{{baseUrl}}/synthesis?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accent_phrases": [\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n ],\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false,\n "kana": ""\n}' \
--output-document \
- '{{baseUrl}}/synthesis?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accent_phrases": [
[
"moras": [
[
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
]
],
"accent": 0,
"pause_mora": [],
"is_interrogative": false
]
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/synthesis?speaker=")! 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
音声合成する(キャンセル可能)
{{baseUrl}}/cancellable_synthesis
QUERY PARAMS
speaker
BODY json
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cancellable_synthesis?speaker=");
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 \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cancellable_synthesis" {:query-params {:speaker ""}
:content-type :json
:form-params {:accent_phrases [{:moras [{:text ""
:consonant ""
:consonant_length ""
:vowel ""
:vowel_length ""
:pitch ""}]
:accent 0
:pause_mora {}
:is_interrogative false}]
:speedScale ""
:pitchScale ""
:intonationScale ""
:volumeScale ""
:prePhonemeLength ""
:postPhonemeLength ""
:pauseLength ""
:pauseLengthScale ""
:outputSamplingRate 0
:outputStereo false
:kana ""}})
require "http/client"
url = "{{baseUrl}}/cancellable_synthesis?speaker="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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}}/cancellable_synthesis?speaker="),
Content = new StringContent("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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}}/cancellable_synthesis?speaker=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cancellable_synthesis?speaker="
payload := strings.NewReader("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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/cancellable_synthesis?speaker= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 572
{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cancellable_synthesis?speaker=")
.setHeader("content-type", "application/json")
.setBody("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cancellable_synthesis?speaker="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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 \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cancellable_synthesis?speaker=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cancellable_synthesis?speaker=")
.header("content-type", "application/json")
.body("{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}")
.asString();
const data = JSON.stringify({
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cancellable_synthesis?speaker=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cancellable_synthesis',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cancellable_synthesis?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accent_phrases":[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}],"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":"","outputSamplingRate":0,"outputStereo":false,"kana":""}'
};
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}}/cancellable_synthesis?speaker=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accent_phrases": [\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n ],\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false,\n "kana": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cancellable_synthesis?speaker=")
.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/cancellable_synthesis?speaker=',
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({
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cancellable_synthesis',
qs: {speaker: ''},
headers: {'content-type': 'application/json'},
body: {
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
},
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}}/cancellable_synthesis');
req.query({
speaker: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
});
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}}/cancellable_synthesis',
params: {speaker: ''},
headers: {'content-type': 'application/json'},
data: {
accent_phrases: [
{
moras: [
{
text: '',
consonant: '',
consonant_length: '',
vowel: '',
vowel_length: '',
pitch: ''
}
],
accent: 0,
pause_mora: {},
is_interrogative: false
}
],
speedScale: '',
pitchScale: '',
intonationScale: '',
volumeScale: '',
prePhonemeLength: '',
postPhonemeLength: '',
pauseLength: '',
pauseLengthScale: '',
outputSamplingRate: 0,
outputStereo: false,
kana: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cancellable_synthesis?speaker=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accent_phrases":[{"moras":[{"text":"","consonant":"","consonant_length":"","vowel":"","vowel_length":"","pitch":""}],"accent":0,"pause_mora":{},"is_interrogative":false}],"speedScale":"","pitchScale":"","intonationScale":"","volumeScale":"","prePhonemeLength":"","postPhonemeLength":"","pauseLength":"","pauseLengthScale":"","outputSamplingRate":0,"outputStereo":false,"kana":""}'
};
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 = @{ @"accent_phrases": @[ @{ @"moras": @[ @{ @"text": @"", @"consonant": @"", @"consonant_length": @"", @"vowel": @"", @"vowel_length": @"", @"pitch": @"" } ], @"accent": @0, @"pause_mora": @{ }, @"is_interrogative": @NO } ],
@"speedScale": @"",
@"pitchScale": @"",
@"intonationScale": @"",
@"volumeScale": @"",
@"prePhonemeLength": @"",
@"postPhonemeLength": @"",
@"pauseLength": @"",
@"pauseLengthScale": @"",
@"outputSamplingRate": @0,
@"outputStereo": @NO,
@"kana": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cancellable_synthesis?speaker="]
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}}/cancellable_synthesis?speaker=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cancellable_synthesis?speaker=",
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([
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]),
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}}/cancellable_synthesis?speaker=', [
'body' => '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cancellable_synthesis');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'speaker' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accent_phrases' => [
[
'moras' => [
[
'text' => '',
'consonant' => '',
'consonant_length' => '',
'vowel' => '',
'vowel_length' => '',
'pitch' => ''
]
],
'accent' => 0,
'pause_mora' => [
],
'is_interrogative' => null
]
],
'speedScale' => '',
'pitchScale' => '',
'intonationScale' => '',
'volumeScale' => '',
'prePhonemeLength' => '',
'postPhonemeLength' => '',
'pauseLength' => '',
'pauseLengthScale' => '',
'outputSamplingRate' => 0,
'outputStereo' => null,
'kana' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cancellable_synthesis');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'speaker' => ''
]));
$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}}/cancellable_synthesis?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cancellable_synthesis?speaker=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/cancellable_synthesis?speaker=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cancellable_synthesis"
querystring = {"speaker":""}
payload = {
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": False
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": False,
"kana": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cancellable_synthesis"
queryString <- list(speaker = "")
payload <- "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cancellable_synthesis?speaker=")
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 \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\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/cancellable_synthesis') do |req|
req.params['speaker'] = ''
req.body = "{\n \"accent_phrases\": [\n {\n \"moras\": [\n {\n \"text\": \"\",\n \"consonant\": \"\",\n \"consonant_length\": \"\",\n \"vowel\": \"\",\n \"vowel_length\": \"\",\n \"pitch\": \"\"\n }\n ],\n \"accent\": 0,\n \"pause_mora\": {},\n \"is_interrogative\": false\n }\n ],\n \"speedScale\": \"\",\n \"pitchScale\": \"\",\n \"intonationScale\": \"\",\n \"volumeScale\": \"\",\n \"prePhonemeLength\": \"\",\n \"postPhonemeLength\": \"\",\n \"pauseLength\": \"\",\n \"pauseLengthScale\": \"\",\n \"outputSamplingRate\": 0,\n \"outputStereo\": false,\n \"kana\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cancellable_synthesis";
let querystring = [
("speaker", ""),
];
let payload = json!({
"accent_phrases": (
json!({
"moras": (
json!({
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
})
),
"accent": 0,
"pause_mora": json!({}),
"is_interrogative": false
})
),
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/cancellable_synthesis?speaker=' \
--header 'content-type: application/json' \
--data '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}'
echo '{
"accent_phrases": [
{
"moras": [
{
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
}
],
"accent": 0,
"pause_mora": {},
"is_interrogative": false
}
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
}' | \
http POST '{{baseUrl}}/cancellable_synthesis?speaker=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accent_phrases": [\n {\n "moras": [\n {\n "text": "",\n "consonant": "",\n "consonant_length": "",\n "vowel": "",\n "vowel_length": "",\n "pitch": ""\n }\n ],\n "accent": 0,\n "pause_mora": {},\n "is_interrogative": false\n }\n ],\n "speedScale": "",\n "pitchScale": "",\n "intonationScale": "",\n "volumeScale": "",\n "prePhonemeLength": "",\n "postPhonemeLength": "",\n "pauseLength": "",\n "pauseLengthScale": "",\n "outputSamplingRate": 0,\n "outputStereo": false,\n "kana": ""\n}' \
--output-document \
- '{{baseUrl}}/cancellable_synthesis?speaker='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accent_phrases": [
[
"moras": [
[
"text": "",
"consonant": "",
"consonant_length": "",
"vowel": "",
"vowel_length": "",
"pitch": ""
]
],
"accent": 0,
"pause_mora": [],
"is_interrogative": false
]
],
"speedScale": "",
"pitchScale": "",
"intonationScale": "",
"volumeScale": "",
"prePhonemeLength": "",
"postPhonemeLength": "",
"pauseLength": "",
"pauseLengthScale": "",
"outputSamplingRate": 0,
"outputStereo": false,
"kana": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cancellable_synthesis?speaker=")! 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()