curl -X POST "http://localhost:3321/getPublicKey" \
-H "Content-Type: application/json" \
-d '{
"seekPermission": true,
"identityKey": true,
"protocolID": [
null
],
"keyID": "string",
"privileged": false,
"privilegedReason": "string",
"counterparty": "string",
"forSelf": false
}'
const response = await fetch(`http://localhost:3321/getPublicKey`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"seekPermission": true,
"identityKey": true,
"protocolID": [
null
],
"keyID": "string",
"privileged": false,
"privilegedReason": "string",
"counterparty": "string",
"forSelf": false
})
});
const data = await response.json();
import requests
response = requests.request(
"POST",
"http://localhost:3321/getPublicKey",
json={
"seekPermission": True,
"identityKey": True,
"protocolID": [
None
],
"keyID": "string",
"privileged": False,
"privilegedReason": "string",
"counterparty": "string",
"forSelf": False
},
)
data = response.json()
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost:3321/getPublicKey");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
"seekPermission": true,
"identityKey": true,
"protocolID": [
null
],
"keyID": "string",
"privileged": false,
"privilegedReason": "string",
"counterparty": "string",
"forSelf": false
}');
$response = curl_exec($ch);
curl_close($ch);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:3321/getPublicKey", strings.NewReader(`{
"seekPermission": true,
"identityKey": true,
"protocolID": [
null
],
"keyID": "string",
"privileged": false,
"privilegedReason": "string",
"counterparty": "string",
"forSelf": false
}`))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:3321/getPublicKey"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"seekPermission\": true,\n \"identityKey\": true,\n \"protocolID\": [\n null\n ],\n \"keyID\": \"string\",\n \"privileged\": false,\n \"privilegedReason\": \"string\",\n \"counterparty\": \"string\",\n \"forSelf\": false\n}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require "net/http"
require "uri"
uri = URI("http://localhost:3321/getPublicKey")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request.body = "{\n \"seekPermission\": true,\n \"identityKey\": true,\n \"protocolID\": [\n null\n ],\n \"keyID\": \"string\",\n \"privileged\": false,\n \"privilegedReason\": \"string\",\n \"counterparty\": \"string\",\n \"forSelf\": false\n}"
response = http.request(request)
puts response.body