curl -X PATCH "https://api.example.com/api/app/persons/<id>" \
-H "Content-Type: application/json" \
-H "X-Tenant: <X-Tenant>" \
-d '{
"hasVisas": true,
"socialAccounts": {
"facebook": "string",
"twitter": "string",
"linkedin": "string",
"instagram": "string"
},
"employmentInfo": [
{
"isCurrent": true,
"from": "2024-01-01",
"to": "2024-01-01",
"employerName": "string",
"description": "string"
}
],
"items": {},
"userId": "00000000-0000-0000-0000-000000000000"
}'
const response = await fetch(`https://api.example.com/api/app/persons/${id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"hasVisas": true,
"socialAccounts": {
"facebook": "string",
"twitter": "string",
"linkedin": "string",
"instagram": "string"
},
"employmentInfo": [
{
"isCurrent": true,
"from": "2024-01-01",
"to": "2024-01-01",
"employerName": "string",
"description": "string"
}
],
"items": {},
"userId": "00000000-0000-0000-0000-000000000000"
})
});
const data = await response.json();
import requests
response = requests.request(
"PATCH",
"https://api.example.com/api/app/persons/{id}",
json={
"hasVisas": True,
"socialAccounts": {
"facebook": "string",
"twitter": "string",
"linkedin": "string",
"instagram": "string"
},
"employmentInfo": [
{
"isCurrent": True,
"from": "2024-01-01",
"to": "2024-01-01",
"employerName": "string",
"description": "string"
}
],
"items": {},
"userId": "00000000-0000-0000-0000-000000000000"
},
)
data = response.json()
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.example.com/api/app/persons/<id>");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
"hasVisas": true,
"socialAccounts": {
"facebook": "string",
"twitter": "string",
"linkedin": "string",
"instagram": "string"
},
"employmentInfo": [
{
"isCurrent": true,
"from": "2024-01-01",
"to": "2024-01-01",
"employerName": "string",
"description": "string"
}
],
"items": {},
"userId": "00000000-0000-0000-0000-000000000000"
}');
$response = curl_exec($ch);
curl_close($ch);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("PATCH", "https://api.example.com/api/app/persons/<id>", strings.NewReader(`{
"hasVisas": true,
"socialAccounts": {
"facebook": "string",
"twitter": "string",
"linkedin": "string",
"instagram": "string"
},
"employmentInfo": [
{
"isCurrent": true,
"from": "2024-01-01",
"to": "2024-01-01",
"employerName": "string",
"description": "string"
}
],
"items": {},
"userId": "00000000-0000-0000-0000-000000000000"
}`))
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("https://api.example.com/api/app/persons/<id>"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"hasVisas\": true,\n \"socialAccounts\": {\n \"facebook\": \"string\",\n \"twitter\": \"string\",\n \"linkedin\": \"string\",\n \"instagram\": \"string\"\n },\n \"employmentInfo\": [\n {\n \"isCurrent\": true,\n \"from\": \"2024-01-01\",\n \"to\": \"2024-01-01\",\n \"employerName\": \"string\",\n \"description\": \"string\"\n }\n ],\n \"items\": {},\n \"userId\": \"00000000-0000-0000-0000-000000000000\"\n}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require "net/http"
require "uri"
uri = URI("https://api.example.com/api/app/persons/<id>")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Patch.new(uri)
request["Content-Type"] = "application/json"
request.body = "{\n \"hasVisas\": true,\n \"socialAccounts\": {\n \"facebook\": \"string\",\n \"twitter\": \"string\",\n \"linkedin\": \"string\",\n \"instagram\": \"string\"\n },\n \"employmentInfo\": [\n {\n \"isCurrent\": true,\n \"from\": \"2024-01-01\",\n \"to\": \"2024-01-01\",\n \"employerName\": \"string\",\n \"description\": \"string\"\n }\n ],\n \"items\": {},\n \"userId\": \"00000000-0000-0000-0000-000000000000\"\n}"
response = http.request(request)
puts response.body