Reviews and Ratings API
GET
Get Product Rating
{{baseUrl}}/rating/:productId
HEADERS
Content-Type
Accept
QUERY PARAMS
productId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/rating/:productId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: ");
headers = curl_slist_append(headers, "accept: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/rating/:productId" {:headers {:content-type ""
:accept ""}})
require "http/client"
url = "{{baseUrl}}/rating/:productId"
headers = HTTP::Headers{
"content-type" => ""
"accept" => ""
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/rating/:productId"),
Headers =
{
{ "accept", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/rating/:productId");
var request = new RestRequest("", Method.Get);
request.AddHeader("content-type", "");
request.AddHeader("accept", "");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/rating/:productId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("content-type", "")
req.Header.Add("accept", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/rating/:productId HTTP/1.1
Content-Type:
Accept:
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/rating/:productId")
.setHeader("content-type", "")
.setHeader("accept", "")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/rating/:productId"))
.header("content-type", "")
.header("accept", "")
.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}}/rating/:productId")
.get()
.addHeader("content-type", "")
.addHeader("accept", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/rating/:productId")
.header("content-type", "")
.header("accept", "")
.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}}/rating/:productId');
xhr.setRequestHeader('content-type', '');
xhr.setRequestHeader('accept', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/rating/:productId',
headers: {'content-type': '', accept: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/rating/:productId';
const options = {method: 'GET', headers: {'content-type': '', accept: ''}};
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}}/rating/:productId',
method: 'GET',
headers: {
'content-type': '',
accept: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/rating/:productId")
.get()
.addHeader("content-type", "")
.addHeader("accept", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/rating/:productId',
headers: {
'content-type': '',
accept: ''
}
};
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}}/rating/:productId',
headers: {'content-type': '', accept: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/rating/:productId');
req.headers({
'content-type': '',
accept: ''
});
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}}/rating/:productId',
headers: {'content-type': '', accept: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/rating/:productId';
const options = {method: 'GET', headers: {'content-type': '', accept: ''}};
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": @"",
@"accept": @"" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/rating/:productId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/rating/:productId" in
let headers = Header.add_list (Header.init ()) [
("content-type", "");
("accept", "");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/rating/:productId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/rating/:productId', [
'headers' => [
'accept' => '',
'content-type' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/rating/:productId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/rating/:productId');
$request->setRequestMethod('GET');
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/rating/:productId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/rating/:productId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'content-type': "",
'accept': ""
}
conn.request("GET", "/baseUrl/rating/:productId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/rating/:productId"
headers = {
"content-type": "",
"accept": ""
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/rating/:productId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/rating/:productId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["content-type"] = ''
request["accept"] = ''
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/rating/:productId') do |req|
req.headers['accept'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/rating/:productId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "".parse().unwrap());
headers.insert("accept", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/rating/:productId \
--header 'accept: ' \
--header 'content-type: '
http GET {{baseUrl}}/rating/:productId \
accept:'' \
content-type:''
wget --quiet \
--method GET \
--header 'content-type: ' \
--header 'accept: ' \
--output-document \
- {{baseUrl}}/rating/:productId
import Foundation
let headers = [
"content-type": "",
"accept": ""
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/rating/:productId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"average": 3.86,
"totalCount": 7
}
POST
Create Multiple Reviews
{{baseUrl}}/reviews
HEADERS
Content-Type
Accept
BODY json
[
{
"approved": false,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reviews");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: ");
headers = curl_slist_append(headers, "accept: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/reviews" {:headers {:accept ""}
:content-type :json
:form-params [{:approved false
:id ""
:productId ""
:rating ""
:reviewerName ""
:text ""
:title ""
:verifiedPurchaser false}]})
require "http/client"
url = "{{baseUrl}}/reviews"
headers = HTTP::Headers{
"content-type" => ""
"accept" => ""
}
reqBody = "[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": 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}}/reviews"),
Headers =
{
{ "accept", "" },
},
Content = new StringContent("[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": 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}}/reviews");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "");
request.AddHeader("accept", "");
request.AddParameter("", "[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reviews"
payload := strings.NewReader("[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "")
req.Header.Add("accept", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/reviews HTTP/1.1
Content-Type:
Accept:
Host: example.com
Content-Length: 175
[
{
"approved": false,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/reviews")
.setHeader("content-type", "")
.setHeader("accept", "")
.setBody("[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reviews"))
.header("content-type", "")
.header("accept", "")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": 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 \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/reviews")
.post(body)
.addHeader("content-type", "")
.addHeader("accept", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/reviews")
.header("content-type", "")
.header("accept", "")
.body("[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]")
.asString();
const data = JSON.stringify([
{
approved: false,
id: '',
productId: '',
rating: '',
reviewerName: '',
text: '',
title: '',
verifiedPurchaser: 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}}/reviews');
xhr.setRequestHeader('content-type', '');
xhr.setRequestHeader('accept', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/reviews',
headers: {'content-type': '', accept: ''},
data: [
{
approved: false,
id: '',
productId: '',
rating: '',
reviewerName: '',
text: '',
title: '',
verifiedPurchaser: false
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reviews';
const options = {
method: 'POST',
headers: {'content-type': '', accept: ''},
body: '[{"approved":false,"id":"","productId":"","rating":"","reviewerName":"","text":"","title":"","verifiedPurchaser":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}}/reviews',
method: 'POST',
headers: {
'content-type': '',
accept: ''
},
processData: false,
data: '[\n {\n "approved": false,\n "id": "",\n "productId": "",\n "rating": "",\n "reviewerName": "",\n "text": "",\n "title": "",\n "verifiedPurchaser": 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 \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]")
val request = Request.Builder()
.url("{{baseUrl}}/reviews")
.post(body)
.addHeader("content-type", "")
.addHeader("accept", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/reviews',
headers: {
'content-type': '',
accept: ''
}
};
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([
{
approved: false,
id: '',
productId: '',
rating: '',
reviewerName: '',
text: '',
title: '',
verifiedPurchaser: false
}
]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/reviews',
headers: {'content-type': '', accept: ''},
body: [
{
approved: false,
id: '',
productId: '',
rating: '',
reviewerName: '',
text: '',
title: '',
verifiedPurchaser: 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}}/reviews');
req.headers({
'content-type': '',
accept: ''
});
req.type('json');
req.send([
{
approved: false,
id: '',
productId: '',
rating: '',
reviewerName: '',
text: '',
title: '',
verifiedPurchaser: 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}}/reviews',
headers: {'content-type': '', accept: ''},
data: [
{
approved: false,
id: '',
productId: '',
rating: '',
reviewerName: '',
text: '',
title: '',
verifiedPurchaser: false
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reviews';
const options = {
method: 'POST',
headers: {'content-type': '', accept: ''},
body: '[{"approved":false,"id":"","productId":"","rating":"","reviewerName":"","text":"","title":"","verifiedPurchaser":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": @"",
@"accept": @"" };
NSDictionary *parameters = @[ @{ @"approved": @NO, @"id": @"", @"productId": @"", @"rating": @"", @"reviewerName": @"", @"text": @"", @"title": @"", @"verifiedPurchaser": @NO } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/reviews"]
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}}/reviews" in
let headers = Header.add_list (Header.init ()) [
("content-type", "");
("accept", "");
] in
let body = Cohttp_lwt_body.of_string "[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reviews",
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([
[
'approved' => null,
'id' => '',
'productId' => '',
'rating' => '',
'reviewerName' => '',
'text' => '',
'title' => '',
'verifiedPurchaser' => null
]
]),
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/reviews', [
'body' => '[
{
"approved": false,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}
]',
'headers' => [
'accept' => '',
'content-type' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/reviews');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
'approved' => null,
'id' => '',
'productId' => '',
'rating' => '',
'reviewerName' => '',
'text' => '',
'title' => '',
'verifiedPurchaser' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
'approved' => null,
'id' => '',
'productId' => '',
'rating' => '',
'reviewerName' => '',
'text' => '',
'title' => '',
'verifiedPurchaser' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/reviews');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/reviews' -Method POST -Headers $headers -ContentType '' -Body '[
{
"approved": false,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}
]'
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reviews' -Method POST -Headers $headers -ContentType '' -Body '[
{
"approved": false,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]"
headers = {
'content-type': "",
'accept': ""
}
conn.request("POST", "/baseUrl/reviews", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reviews"
payload = [
{
"approved": False,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": False
}
]
headers = {
"content-type": "",
"accept": ""
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reviews"
payload <- "[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\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}}/reviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = ''
request["accept"] = ''
request.body = "[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n }\n]"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/reviews') do |req|
req.headers['accept'] = ''
req.body = "[\n {\n \"approved\": false,\n \"id\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": 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}}/reviews";
let payload = (
json!({
"approved": false,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": false
})
);
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "".parse().unwrap());
headers.insert("accept", "".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}}/reviews \
--header 'accept: ' \
--header 'content-type: ' \
--data '[
{
"approved": false,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}
]'
echo '[
{
"approved": false,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}
]' | \
http POST {{baseUrl}}/reviews \
accept:'' \
content-type:''
wget --quiet \
--method POST \
--header 'content-type: ' \
--header 'accept: ' \
--body-data '[\n {\n "approved": false,\n "id": "",\n "productId": "",\n "rating": "",\n "reviewerName": "",\n "text": "",\n "title": "",\n "verifiedPurchaser": false\n }\n]' \
--output-document \
- {{baseUrl}}/reviews
import Foundation
let headers = [
"content-type": "",
"accept": ""
]
let parameters = [
[
"approved": false,
"id": "",
"productId": "",
"rating": "",
"reviewerName": "",
"text": "",
"title": "",
"verifiedPurchaser": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reviews")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
"8e1a5e11-c0c9-11ec-835d-0a591b8a3ec1",
"9257c203-c0c9-11ec-835d-0e02dd207951"
]
POST
Create a Review
{{baseUrl}}/review
HEADERS
Content-Type
Accept
BODY json
{
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/review");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: ");
headers = curl_slist_append(headers, "accept: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/review" {:headers {:accept ""}
:content-type :json
:form-params {:productId ""
:rating 0
:reviewerName ""
:text ""
:title ""}})
require "http/client"
url = "{{baseUrl}}/review"
headers = HTTP::Headers{
"content-type" => ""
"accept" => ""
}
reqBody = "{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\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}}/review"),
Headers =
{
{ "accept", "" },
},
Content = new StringContent("{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\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}}/review");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "");
request.AddHeader("accept", "");
request.AddParameter("", "{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/review"
payload := strings.NewReader("{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "")
req.Header.Add("accept", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/review HTTP/1.1
Content-Type:
Accept:
Host: example.com
Content-Length: 87
{
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/review")
.setHeader("content-type", "")
.setHeader("accept", "")
.setBody("{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/review"))
.header("content-type", "")
.header("accept", "")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\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 \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/review")
.post(body)
.addHeader("content-type", "")
.addHeader("accept", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/review")
.header("content-type", "")
.header("accept", "")
.body("{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}")
.asString();
const data = JSON.stringify({
productId: '',
rating: 0,
reviewerName: '',
text: '',
title: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/review');
xhr.setRequestHeader('content-type', '');
xhr.setRequestHeader('accept', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/review',
headers: {'content-type': '', accept: ''},
data: {productId: '', rating: 0, reviewerName: '', text: '', title: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/review';
const options = {
method: 'POST',
headers: {'content-type': '', accept: ''},
body: '{"productId":"","rating":0,"reviewerName":"","text":"","title":""}'
};
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}}/review',
method: 'POST',
headers: {
'content-type': '',
accept: ''
},
processData: false,
data: '{\n "productId": "",\n "rating": 0,\n "reviewerName": "",\n "text": "",\n "title": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/review")
.post(body)
.addHeader("content-type", "")
.addHeader("accept", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/review',
headers: {
'content-type': '',
accept: ''
}
};
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({productId: '', rating: 0, reviewerName: '', text: '', title: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/review',
headers: {'content-type': '', accept: ''},
body: {productId: '', rating: 0, reviewerName: '', text: '', title: ''},
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}}/review');
req.headers({
'content-type': '',
accept: ''
});
req.type('json');
req.send({
productId: '',
rating: 0,
reviewerName: '',
text: '',
title: ''
});
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}}/review',
headers: {'content-type': '', accept: ''},
data: {productId: '', rating: 0, reviewerName: '', text: '', title: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/review';
const options = {
method: 'POST',
headers: {'content-type': '', accept: ''},
body: '{"productId":"","rating":0,"reviewerName":"","text":"","title":""}'
};
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": @"",
@"accept": @"" };
NSDictionary *parameters = @{ @"productId": @"",
@"rating": @0,
@"reviewerName": @"",
@"text": @"",
@"title": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/review"]
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}}/review" in
let headers = Header.add_list (Header.init ()) [
("content-type", "");
("accept", "");
] in
let body = Cohttp_lwt_body.of_string "{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/review",
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([
'productId' => '',
'rating' => 0,
'reviewerName' => '',
'text' => '',
'title' => ''
]),
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/review', [
'body' => '{
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
}',
'headers' => [
'accept' => '',
'content-type' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/review');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'productId' => '',
'rating' => 0,
'reviewerName' => '',
'text' => '',
'title' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'productId' => '',
'rating' => 0,
'reviewerName' => '',
'text' => '',
'title' => ''
]));
$request->setRequestUrl('{{baseUrl}}/review');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/review' -Method POST -Headers $headers -ContentType '' -Body '{
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
}'
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/review' -Method POST -Headers $headers -ContentType '' -Body '{
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}"
headers = {
'content-type': "",
'accept': ""
}
conn.request("POST", "/baseUrl/review", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/review"
payload = {
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
}
headers = {
"content-type": "",
"accept": ""
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/review"
payload <- "{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\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}}/review")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = ''
request["accept"] = ''
request.body = "{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/review') do |req|
req.headers['accept'] = ''
req.body = "{\n \"productId\": \"\",\n \"rating\": 0,\n \"reviewerName\": \"\",\n \"text\": \"\",\n \"title\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/review";
let payload = json!({
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "".parse().unwrap());
headers.insert("accept", "".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}}/review \
--header 'accept: ' \
--header 'content-type: ' \
--data '{
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
}'
echo '{
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
}' | \
http POST {{baseUrl}}/review \
accept:'' \
content-type:''
wget --quiet \
--method POST \
--header 'content-type: ' \
--header 'accept: ' \
--body-data '{\n "productId": "",\n "rating": 0,\n "reviewerName": "",\n "text": "",\n "title": ""\n}' \
--output-document \
- {{baseUrl}}/review
import Foundation
let headers = [
"content-type": "",
"accept": ""
]
let parameters = [
"productId": "",
"rating": 0,
"reviewerName": "",
"text": "",
"title": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/review")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"approved": false,
"id": "5323fdaa-c012-11ec-835d-0ebee58edbb3",
"locale": "en-US",
"location": null,
"pastReviews": null,
"productId": "65444",
"rating": 5,
"reviewDateTime": "04/19/2022 18:55:58",
"reviewerName": "Arturo",
"searchDate": "2022-04-19T18:55:58Z",
"shopperId": "user@email.com",
"sku": "2",
"text": "It is the best product that I have seen",
"title": "Good Product",
"verifiedPurchaser": false
}
DELETE
Delete Multiple Reviews
{{baseUrl}}/reviews
HEADERS
Content-Type
Accept
BODY json
[
{}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reviews");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: ");
headers = curl_slist_append(headers, "accept: ");
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/delete "{{baseUrl}}/reviews" {:headers {:accept ""}
:content-type :json
:form-params [{}]})
require "http/client"
url = "{{baseUrl}}/reviews"
headers = HTTP::Headers{
"content-type" => ""
"accept" => ""
}
reqBody = "[\n {}\n]"
response = HTTP::Client.delete url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/reviews"),
Headers =
{
{ "accept", "" },
},
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}}/reviews");
var request = new RestRequest("", Method.Delete);
request.AddHeader("content-type", "");
request.AddHeader("accept", "");
request.AddParameter("", "[\n {}\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reviews"
payload := strings.NewReader("[\n {}\n]")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("content-type", "")
req.Header.Add("accept", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/reviews HTTP/1.1
Content-Type:
Accept:
Host: example.com
Content-Length: 8
[
{}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/reviews")
.setHeader("content-type", "")
.setHeader("accept", "")
.setBody("[\n {}\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reviews"))
.header("content-type", "")
.header("accept", "")
.method("DELETE", 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}}/reviews")
.delete(body)
.addHeader("content-type", "")
.addHeader("accept", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/reviews")
.header("content-type", "")
.header("accept", "")
.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('DELETE', '{{baseUrl}}/reviews');
xhr.setRequestHeader('content-type', '');
xhr.setRequestHeader('accept', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/reviews',
headers: {'content-type': '', accept: ''},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reviews';
const options = {method: 'DELETE', headers: {'content-type': '', accept: ''}, 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}}/reviews',
method: 'DELETE',
headers: {
'content-type': '',
accept: ''
},
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}}/reviews")
.delete(body)
.addHeader("content-type", "")
.addHeader("accept", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/reviews',
headers: {
'content-type': '',
accept: ''
}
};
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: 'DELETE',
url: '{{baseUrl}}/reviews',
headers: {'content-type': '', accept: ''},
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('DELETE', '{{baseUrl}}/reviews');
req.headers({
'content-type': '',
accept: ''
});
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: 'DELETE',
url: '{{baseUrl}}/reviews',
headers: {'content-type': '', accept: ''},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reviews';
const options = {method: 'DELETE', headers: {'content-type': '', accept: ''}, 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": @"",
@"accept": @"" };
NSDictionary *parameters = @[ @{ } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/reviews"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[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}}/reviews" in
let headers = Header.add_list (Header.init ()) [
("content-type", "");
("accept", "");
] in
let body = Cohttp_lwt_body.of_string "[\n {}\n]" in
Client.call ~headers ~body `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reviews",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
[
]
]),
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/reviews', [
'body' => '[
{}
]',
'headers' => [
'accept' => '',
'content-type' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/reviews');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$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}}/reviews');
$request->setRequestMethod('DELETE');
$request->setBody($body);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/reviews' -Method DELETE -Headers $headers -ContentType '' -Body '[
{}
]'
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reviews' -Method DELETE -Headers $headers -ContentType '' -Body '[
{}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {}\n]"
headers = {
'content-type': "",
'accept': ""
}
conn.request("DELETE", "/baseUrl/reviews", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reviews"
payload = [{}]
headers = {
"content-type": "",
"accept": ""
}
response = requests.delete(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reviews"
payload <- "[\n {}\n]"
encode <- "json"
response <- VERB("DELETE", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/reviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["content-type"] = ''
request["accept"] = ''
request.body = "[\n {}\n]"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/reviews') do |req|
req.headers['accept'] = ''
req.body = "[\n {}\n]"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reviews";
let payload = (json!({}));
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "".parse().unwrap());
headers.insert("accept", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/reviews \
--header 'accept: ' \
--header 'content-type: ' \
--data '[
{}
]'
echo '[
{}
]' | \
http DELETE {{baseUrl}}/reviews \
accept:'' \
content-type:''
wget --quiet \
--method DELETE \
--header 'content-type: ' \
--header 'accept: ' \
--body-data '[\n {}\n]' \
--output-document \
- {{baseUrl}}/reviews
import Foundation
let headers = [
"content-type": "",
"accept": ""
]
let parameters = [[]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reviews")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
true
DELETE
Delete Review
{{baseUrl}}/review/:reviewId
HEADERS
Content-Type
Accept
QUERY PARAMS
reviewId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/review/:reviewId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: ");
headers = curl_slist_append(headers, "accept: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/review/:reviewId" {:headers {:content-type ""
:accept ""}})
require "http/client"
url = "{{baseUrl}}/review/:reviewId"
headers = HTTP::Headers{
"content-type" => ""
"accept" => ""
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/review/:reviewId"),
Headers =
{
{ "accept", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/review/:reviewId");
var request = new RestRequest("", Method.Delete);
request.AddHeader("content-type", "");
request.AddHeader("accept", "");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/review/:reviewId"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("content-type", "")
req.Header.Add("accept", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/review/:reviewId HTTP/1.1
Content-Type:
Accept:
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/review/:reviewId")
.setHeader("content-type", "")
.setHeader("accept", "")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/review/:reviewId"))
.header("content-type", "")
.header("accept", "")
.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}}/review/:reviewId")
.delete(null)
.addHeader("content-type", "")
.addHeader("accept", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/review/:reviewId")
.header("content-type", "")
.header("accept", "")
.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}}/review/:reviewId');
xhr.setRequestHeader('content-type', '');
xhr.setRequestHeader('accept', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/review/:reviewId',
headers: {'content-type': '', accept: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/review/:reviewId';
const options = {method: 'DELETE', headers: {'content-type': '', accept: ''}};
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}}/review/:reviewId',
method: 'DELETE',
headers: {
'content-type': '',
accept: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/review/:reviewId")
.delete(null)
.addHeader("content-type", "")
.addHeader("accept", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/review/:reviewId',
headers: {
'content-type': '',
accept: ''
}
};
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}}/review/:reviewId',
headers: {'content-type': '', accept: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/review/:reviewId');
req.headers({
'content-type': '',
accept: ''
});
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}}/review/:reviewId',
headers: {'content-type': '', accept: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/review/:reviewId';
const options = {method: 'DELETE', headers: {'content-type': '', accept: ''}};
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": @"",
@"accept": @"" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/review/:reviewId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
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}}/review/:reviewId" in
let headers = Header.add_list (Header.init ()) [
("content-type", "");
("accept", "");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/review/:reviewId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/review/:reviewId', [
'headers' => [
'accept' => '',
'content-type' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/review/:reviewId');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/review/:reviewId');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/review/:reviewId' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/review/:reviewId' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'content-type': "",
'accept': ""
}
conn.request("DELETE", "/baseUrl/review/:reviewId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/review/:reviewId"
headers = {
"content-type": "",
"accept": ""
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/review/:reviewId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/review/:reviewId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["content-type"] = ''
request["accept"] = ''
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/review/:reviewId') do |req|
req.headers['accept'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/review/:reviewId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "".parse().unwrap());
headers.insert("accept", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/review/:reviewId \
--header 'accept: ' \
--header 'content-type: '
http DELETE {{baseUrl}}/review/:reviewId \
accept:'' \
content-type:''
wget --quiet \
--method DELETE \
--header 'content-type: ' \
--header 'accept: ' \
--output-document \
- {{baseUrl}}/review/:reviewId
import Foundation
let headers = [
"content-type": "",
"accept": ""
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/review/:reviewId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
true
GET
Get Review by Review ID
{{baseUrl}}/review/:reviewId
HEADERS
Content-Type
Accept
QUERY PARAMS
reviewId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/review/:reviewId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: ");
headers = curl_slist_append(headers, "accept: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/review/:reviewId" {:headers {:content-type ""
:accept ""}})
require "http/client"
url = "{{baseUrl}}/review/:reviewId"
headers = HTTP::Headers{
"content-type" => ""
"accept" => ""
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/review/:reviewId"),
Headers =
{
{ "accept", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/review/:reviewId");
var request = new RestRequest("", Method.Get);
request.AddHeader("content-type", "");
request.AddHeader("accept", "");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/review/:reviewId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("content-type", "")
req.Header.Add("accept", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/review/:reviewId HTTP/1.1
Content-Type:
Accept:
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/review/:reviewId")
.setHeader("content-type", "")
.setHeader("accept", "")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/review/:reviewId"))
.header("content-type", "")
.header("accept", "")
.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}}/review/:reviewId")
.get()
.addHeader("content-type", "")
.addHeader("accept", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/review/:reviewId")
.header("content-type", "")
.header("accept", "")
.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}}/review/:reviewId');
xhr.setRequestHeader('content-type', '');
xhr.setRequestHeader('accept', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/review/:reviewId',
headers: {'content-type': '', accept: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/review/:reviewId';
const options = {method: 'GET', headers: {'content-type': '', accept: ''}};
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}}/review/:reviewId',
method: 'GET',
headers: {
'content-type': '',
accept: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/review/:reviewId")
.get()
.addHeader("content-type", "")
.addHeader("accept", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/review/:reviewId',
headers: {
'content-type': '',
accept: ''
}
};
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}}/review/:reviewId',
headers: {'content-type': '', accept: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/review/:reviewId');
req.headers({
'content-type': '',
accept: ''
});
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}}/review/:reviewId',
headers: {'content-type': '', accept: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/review/:reviewId';
const options = {method: 'GET', headers: {'content-type': '', accept: ''}};
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": @"",
@"accept": @"" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/review/:reviewId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/review/:reviewId" in
let headers = Header.add_list (Header.init ()) [
("content-type", "");
("accept", "");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/review/:reviewId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/review/:reviewId', [
'headers' => [
'accept' => '',
'content-type' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/review/:reviewId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/review/:reviewId');
$request->setRequestMethod('GET');
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/review/:reviewId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/review/:reviewId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'content-type': "",
'accept': ""
}
conn.request("GET", "/baseUrl/review/:reviewId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/review/:reviewId"
headers = {
"content-type": "",
"accept": ""
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/review/:reviewId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/review/:reviewId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["content-type"] = ''
request["accept"] = ''
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/review/:reviewId') do |req|
req.headers['accept'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/review/:reviewId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "".parse().unwrap());
headers.insert("accept", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/review/:reviewId \
--header 'accept: ' \
--header 'content-type: '
http GET {{baseUrl}}/review/:reviewId \
accept:'' \
content-type:''
wget --quiet \
--method GET \
--header 'content-type: ' \
--header 'accept: ' \
--output-document \
- {{baseUrl}}/review/:reviewId
import Foundation
let headers = [
"content-type": "",
"accept": ""
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/review/:reviewId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"approved": false,
"id": "5323fdaa-c012-11ec-835d-0ebee58edbb3",
"locale": "en-US",
"location": null,
"pastReviews": null,
"productId": "1",
"rating": 5,
"reviewDateTime": "04/19/2022 18:55:58",
"reviewerName": "Arturo",
"searchDate": "2022-04-19T18:55:58Z",
"shopperId": "user@email.com",
"sku": "2",
"text": "Great product.",
"title": "Great product",
"verifiedPurchaser": false
}
GET
Get a list of Reviews
{{baseUrl}}/reviews
HEADERS
Content-Type
Accept
QUERY PARAMS
search_term
from
to
order_by
status
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: ");
headers = curl_slist_append(headers, "accept: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/reviews" {:headers {:content-type ""
:accept ""}
:query-params {:search_term ""
:from ""
:to ""
:order_by ""
:status ""
:product_id ""}})
require "http/client"
url = "{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id="
headers = HTTP::Headers{
"content-type" => ""
"accept" => ""
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id="),
Headers =
{
{ "accept", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("content-type", "");
request.AddHeader("accept", "");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("content-type", "")
req.Header.Add("accept", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/reviews?search_term=&from=&to=&order_by=&status=&product_id= HTTP/1.1
Content-Type:
Accept:
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=")
.setHeader("content-type", "")
.setHeader("accept", "")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id="))
.header("content-type", "")
.header("accept", "")
.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}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=")
.get()
.addHeader("content-type", "")
.addHeader("accept", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=")
.header("content-type", "")
.header("accept", "")
.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}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=');
xhr.setRequestHeader('content-type', '');
xhr.setRequestHeader('accept', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/reviews',
params: {search_term: '', from: '', to: '', order_by: '', status: '', product_id: ''},
headers: {'content-type': '', accept: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=';
const options = {method: 'GET', headers: {'content-type': '', accept: ''}};
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}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=',
method: 'GET',
headers: {
'content-type': '',
accept: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=")
.get()
.addHeader("content-type", "")
.addHeader("accept", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/reviews?search_term=&from=&to=&order_by=&status=&product_id=',
headers: {
'content-type': '',
accept: ''
}
};
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}}/reviews',
qs: {search_term: '', from: '', to: '', order_by: '', status: '', product_id: ''},
headers: {'content-type': '', accept: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/reviews');
req.query({
search_term: '',
from: '',
to: '',
order_by: '',
status: '',
product_id: ''
});
req.headers({
'content-type': '',
accept: ''
});
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}}/reviews',
params: {search_term: '', from: '', to: '', order_by: '', status: '', product_id: ''},
headers: {'content-type': '', accept: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=';
const options = {method: 'GET', headers: {'content-type': '', accept: ''}};
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": @"",
@"accept": @"" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=" in
let headers = Header.add_list (Header.init ()) [
("content-type", "");
("accept", "");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=', [
'headers' => [
'accept' => '',
'content-type' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/reviews');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'search_term' => '',
'from' => '',
'to' => '',
'order_by' => '',
'status' => '',
'product_id' => ''
]);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/reviews');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'search_term' => '',
'from' => '',
'to' => '',
'order_by' => '',
'status' => '',
'product_id' => ''
]));
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'content-type': "",
'accept': ""
}
conn.request("GET", "/baseUrl/reviews?search_term=&from=&to=&order_by=&status=&product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reviews"
querystring = {"search_term":"","from":"","to":"","order_by":"","status":"","product_id":""}
headers = {
"content-type": "",
"accept": ""
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reviews"
queryString <- list(
search_term = "",
from = "",
to = "",
order_by = "",
status = "",
product_id = ""
)
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["content-type"] = ''
request["accept"] = ''
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/reviews') do |req|
req.headers['accept'] = ''
req.params['search_term'] = ''
req.params['from'] = ''
req.params['to'] = ''
req.params['order_by'] = ''
req.params['status'] = ''
req.params['product_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reviews";
let querystring = [
("search_term", ""),
("from", ""),
("to", ""),
("order_by", ""),
("status", ""),
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "".parse().unwrap());
headers.insert("accept", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=' \
--header 'accept: ' \
--header 'content-type: '
http GET '{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=' \
accept:'' \
content-type:''
wget --quiet \
--method GET \
--header 'content-type: ' \
--header 'accept: ' \
--output-document \
- '{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id='
import Foundation
let headers = [
"content-type": "",
"accept": ""
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reviews?search_term=&from=&to=&order_by=&status=&product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"data": [
{
"approved": true,
"id": "1",
"locale": null,
"location": "",
"pastReviews": null,
"productId": "880035",
"rating": 3,
"reviewDateTime": "06/02/2021 20:58:43",
"reviewerName": "anon",
"searchDate": "2021-06-02T20:58:43Z",
"shopperId": "anon@email.com",
"sku": null,
"text": "anon",
"title": "anon",
"verifiedPurchaser": false
},
{
"approved": true,
"id": "2",
"locale": null,
"location": "",
"pastReviews": null,
"productId": "880035",
"rating": 5,
"reviewDateTime": "06/02/2021 21:00:00",
"reviewerName": "Brian",
"searchDate": "2021-06-02T21:00:00Z",
"shopperId": "brian@email.com.br",
"sku": null,
"text": "it's cool",
"title": "logged in",
"verifiedPurchaser": false
},
{
"approved": true,
"id": "c66d8bc0-787c-11ec-82ac-028dd4526e77",
"locale": "ko-KR",
"location": null,
"pastReviews": null,
"productId": "880035",
"rating": 3,
"reviewDateTime": "01/18/2022 16:36:33",
"reviewerName": "ko-KR",
"searchDate": "2022-01-18T16:36:33Z",
"shopperId": "user@email.com",
"sku": null,
"text": "ko-KR",
"title": "Korean",
"verifiedPurchaser": false
}
],
"range": {
"from": 0,
"to": 3,
"total": 26
}
}
PATCH
Update a Review
{{baseUrl}}/review/:reviewId
HEADERS
Content-Type
Accept
QUERY PARAMS
reviewId
BODY json
{
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/review/:reviewId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: ");
headers = curl_slist_append(headers, "accept: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/review/:reviewId" {:headers {:accept ""}
:content-type :json
:form-params {:locale ""
:productId ""
:rating ""
:reviewerName ""
:shopperId ""
:text ""
:title ""
:verifiedPurchaser false}})
require "http/client"
url = "{{baseUrl}}/review/:reviewId"
headers = HTTP::Headers{
"content-type" => ""
"accept" => ""
}
reqBody = "{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/review/:reviewId"),
Headers =
{
{ "accept", "" },
},
Content = new StringContent("{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": 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}}/review/:reviewId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "");
request.AddHeader("accept", "");
request.AddParameter("", "{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/review/:reviewId"
payload := strings.NewReader("{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("content-type", "")
req.Header.Add("accept", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/review/:reviewId HTTP/1.1
Content-Type:
Accept:
Host: example.com
Content-Length: 153
{
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/review/:reviewId")
.setHeader("content-type", "")
.setHeader("accept", "")
.setBody("{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/review/:reviewId"))
.header("content-type", "")
.header("accept", "")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": 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 \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/review/:reviewId")
.patch(body)
.addHeader("content-type", "")
.addHeader("accept", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/review/:reviewId")
.header("content-type", "")
.header("accept", "")
.body("{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}")
.asString();
const data = JSON.stringify({
locale: '',
productId: '',
rating: '',
reviewerName: '',
shopperId: '',
text: '',
title: '',
verifiedPurchaser: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/review/:reviewId');
xhr.setRequestHeader('content-type', '');
xhr.setRequestHeader('accept', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/review/:reviewId',
headers: {'content-type': '', accept: ''},
data: {
locale: '',
productId: '',
rating: '',
reviewerName: '',
shopperId: '',
text: '',
title: '',
verifiedPurchaser: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/review/:reviewId';
const options = {
method: 'PATCH',
headers: {'content-type': '', accept: ''},
body: '{"locale":"","productId":"","rating":"","reviewerName":"","shopperId":"","text":"","title":"","verifiedPurchaser":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}}/review/:reviewId',
method: 'PATCH',
headers: {
'content-type': '',
accept: ''
},
processData: false,
data: '{\n "locale": "",\n "productId": "",\n "rating": "",\n "reviewerName": "",\n "shopperId": "",\n "text": "",\n "title": "",\n "verifiedPurchaser": 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 \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/review/:reviewId")
.patch(body)
.addHeader("content-type", "")
.addHeader("accept", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/review/:reviewId',
headers: {
'content-type': '',
accept: ''
}
};
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({
locale: '',
productId: '',
rating: '',
reviewerName: '',
shopperId: '',
text: '',
title: '',
verifiedPurchaser: false
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/review/:reviewId',
headers: {'content-type': '', accept: ''},
body: {
locale: '',
productId: '',
rating: '',
reviewerName: '',
shopperId: '',
text: '',
title: '',
verifiedPurchaser: 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('PATCH', '{{baseUrl}}/review/:reviewId');
req.headers({
'content-type': '',
accept: ''
});
req.type('json');
req.send({
locale: '',
productId: '',
rating: '',
reviewerName: '',
shopperId: '',
text: '',
title: '',
verifiedPurchaser: 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: 'PATCH',
url: '{{baseUrl}}/review/:reviewId',
headers: {'content-type': '', accept: ''},
data: {
locale: '',
productId: '',
rating: '',
reviewerName: '',
shopperId: '',
text: '',
title: '',
verifiedPurchaser: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/review/:reviewId';
const options = {
method: 'PATCH',
headers: {'content-type': '', accept: ''},
body: '{"locale":"","productId":"","rating":"","reviewerName":"","shopperId":"","text":"","title":"","verifiedPurchaser":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": @"",
@"accept": @"" };
NSDictionary *parameters = @{ @"locale": @"",
@"productId": @"",
@"rating": @"",
@"reviewerName": @"",
@"shopperId": @"",
@"text": @"",
@"title": @"",
@"verifiedPurchaser": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/review/:reviewId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/review/:reviewId" in
let headers = Header.add_list (Header.init ()) [
("content-type", "");
("accept", "");
] in
let body = Cohttp_lwt_body.of_string "{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/review/:reviewId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'locale' => '',
'productId' => '',
'rating' => '',
'reviewerName' => '',
'shopperId' => '',
'text' => '',
'title' => '',
'verifiedPurchaser' => null
]),
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/review/:reviewId', [
'body' => '{
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}',
'headers' => [
'accept' => '',
'content-type' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/review/:reviewId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'locale' => '',
'productId' => '',
'rating' => '',
'reviewerName' => '',
'shopperId' => '',
'text' => '',
'title' => '',
'verifiedPurchaser' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'locale' => '',
'productId' => '',
'rating' => '',
'reviewerName' => '',
'shopperId' => '',
'text' => '',
'title' => '',
'verifiedPurchaser' => null
]));
$request->setRequestUrl('{{baseUrl}}/review/:reviewId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => '',
'accept' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/review/:reviewId' -Method PATCH -Headers $headers -ContentType '' -Body '{
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}'
$headers=@{}
$headers.Add("content-type", "")
$headers.Add("accept", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/review/:reviewId' -Method PATCH -Headers $headers -ContentType '' -Body '{
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}"
headers = {
'content-type': "",
'accept': ""
}
conn.request("PATCH", "/baseUrl/review/:reviewId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/review/:reviewId"
payload = {
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": False
}
headers = {
"content-type": "",
"accept": ""
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/review/:reviewId"
payload <- "{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/review/:reviewId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = ''
request["accept"] = ''
request.body = "{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.patch('/baseUrl/review/:reviewId') do |req|
req.headers['accept'] = ''
req.body = "{\n \"locale\": \"\",\n \"productId\": \"\",\n \"rating\": \"\",\n \"reviewerName\": \"\",\n \"shopperId\": \"\",\n \"text\": \"\",\n \"title\": \"\",\n \"verifiedPurchaser\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/review/:reviewId";
let payload = json!({
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "".parse().unwrap());
headers.insert("accept", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/review/:reviewId \
--header 'accept: ' \
--header 'content-type: ' \
--data '{
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}'
echo '{
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": false
}' | \
http PATCH {{baseUrl}}/review/:reviewId \
accept:'' \
content-type:''
wget --quiet \
--method PATCH \
--header 'content-type: ' \
--header 'accept: ' \
--body-data '{\n "locale": "",\n "productId": "",\n "rating": "",\n "reviewerName": "",\n "shopperId": "",\n "text": "",\n "title": "",\n "verifiedPurchaser": false\n}' \
--output-document \
- {{baseUrl}}/review/:reviewId
import Foundation
let headers = [
"content-type": "",
"accept": ""
]
let parameters = [
"locale": "",
"productId": "",
"rating": "",
"reviewerName": "",
"shopperId": "",
"text": "",
"title": "",
"verifiedPurchaser": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/review/:reviewId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"approved": false,
"id": "5323fdaa-c012-11ec-835d-0ebee58edbb3",
"locale": "en-US",
"location": null,
"pastReviews": null,
"productId": "1",
"rating": 5,
"reviewDateTime": "04/19/2022 18:55:58",
"reviewerName": "Arturo",
"searchDate": "2022-04-19T18:55:58Z",
"shopperId": "user@email.com",
"sku": "2",
"text": "Great product.",
"title": "Great product",
"verifiedPurchaser": false
}