1,000,000+ Recipe and Grocery List API (v2)
1,000,000+ Recipe and Grocery List API (v2)vpartner
Documentation This is the documentation for the partner endpoint of the BigOven Recipe and Grocery List API. The update brings with it Swagger-based documentation. Swagger is an emerging standard for describing REST-based APIs, and with this Swagger-compliant endpoint (above), you can make ready-to-go interface libraries for your code via swagger-codegen. For instance, it's easy to generate libraries for Node.js, Java, Ruby, ASP.NET MVC, jQuery, php and more! You can also try out the endpoint calls with your own apikey right here on this page. Be sure to enter your apikey above to use the…
- Endpoints
- 66 (33 GET, 17 POST, 10 PUT, 6 DELETE)
- Base URL
https://api2.bigoven.com- Authentication
- API key, Basic auth
- Spec format
- OpenAPI 3.0.0
- API version
- partner
- Source
- api2.bigoven.com
- Provider
- bigoven.com
- Last updated
Use this API in Bruno:
- Download the Bruno collection above and unzip it.
- In Bruno, choose Open Collection and select the unzipped folder.
- Set the
baseUrlvariable (for examplehttps://api2.bigoven.com) and your API key credentials, then send requests.
GET
Get the list of current, seasonal recipe collections. From here, you can use the -collection-{id} endpoint to retrieve the recipes in those collections.
{{baseUrl}}/collections
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/collections");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/collections")
require "http/client"
url = "{{baseUrl}}/collections"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/collections"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/collections");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/collections"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/collections HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/collections")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/collections"))
.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}}/collections")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/collections")
.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}}/collections');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/collections'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/collections';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/collections',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/collections")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/collections',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/collections'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/collections');
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}}/collections'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/collections';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/collections"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/collections" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/collections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/collections');
echo $response->getBody();
setUrl('{{baseUrl}}/collections');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/collections');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/collections' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/collections' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/collections")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/collections"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/collections"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/collections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/collections') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/collections";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/collections
http GET {{baseUrl}}/collections
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/collections
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/collections")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Gets a recipe collection metadata. A recipe collection is a curated set of recipes.
{{baseUrl}}/collection/:id/meta
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/collection/:id/meta");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/collection/:id/meta")
require "http/client"
url = "{{baseUrl}}/collection/:id/meta"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/collection/:id/meta"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/collection/:id/meta");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/collection/:id/meta"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/collection/:id/meta HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/collection/:id/meta")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/collection/:id/meta"))
.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}}/collection/:id/meta")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/collection/:id/meta")
.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}}/collection/:id/meta');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/collection/:id/meta'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/collection/:id/meta';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/collection/:id/meta',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/collection/:id/meta")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/collection/:id/meta',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/collection/:id/meta'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/collection/:id/meta');
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}}/collection/:id/meta'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/collection/:id/meta';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/collection/:id/meta"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/collection/:id/meta" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/collection/:id/meta",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/collection/:id/meta');
echo $response->getBody();
setUrl('{{baseUrl}}/collection/:id/meta');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/collection/:id/meta');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/collection/:id/meta' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/collection/:id/meta' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/collection/:id/meta")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/collection/:id/meta"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/collection/:id/meta"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/collection/:id/meta")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/collection/:id/meta') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/collection/:id/meta";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/collection/:id/meta
http GET {{baseUrl}}/collection/:id/meta
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/collection/:id/meta
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/collection/:id/meta")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Gets a recipe collection. A recipe collection is a curated set of recipes.
{{baseUrl}}/collection/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/collection/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/collection/:id")
require "http/client"
url = "{{baseUrl}}/collection/:id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/collection/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/collection/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/collection/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/collection/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/collection/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/collection/:id"))
.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}}/collection/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/collection/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/collection/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/collection/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/collection/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/collection/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/collection/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/collection/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/collection/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/collection/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/collection/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/collection/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/collection/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/collection/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/collection/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/collection/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/collection/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/collection/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/collection/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/collection/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/collection/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/collection/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/collection/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/collection/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/collection/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/collection/:id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/collection/:id
http GET {{baseUrl}}/collection/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/collection/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/collection/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
-grocerylist-item-{guid} DELETE will delete this item assuming you own it.
{{baseUrl}}/grocerylist/item/:guid
QUERY PARAMS
guid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/grocerylist/item/:guid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/grocerylist/item/:guid")
require "http/client"
url = "{{baseUrl}}/grocerylist/item/:guid"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/grocerylist/item/:guid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/grocerylist/item/:guid");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/grocerylist/item/:guid"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/grocerylist/item/:guid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/grocerylist/item/:guid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/grocerylist/item/:guid"))
.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}}/grocerylist/item/:guid")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/grocerylist/item/:guid")
.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}}/grocerylist/item/:guid');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/grocerylist/item/:guid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/grocerylist/item/:guid';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/grocerylist/item/:guid',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/grocerylist/item/:guid")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/grocerylist/item/:guid',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'DELETE', url: '{{baseUrl}}/grocerylist/item/:guid'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/grocerylist/item/:guid');
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}}/grocerylist/item/:guid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/grocerylist/item/:guid';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/grocerylist/item/:guid"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/grocerylist/item/:guid" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/grocerylist/item/:guid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/grocerylist/item/:guid');
echo $response->getBody();
setUrl('{{baseUrl}}/grocerylist/item/:guid');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/grocerylist/item/:guid');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/grocerylist/item/:guid' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/grocerylist/item/:guid' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/grocerylist/item/:guid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/grocerylist/item/:guid"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/grocerylist/item/:guid"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/grocerylist/item/:guid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/grocerylist/item/:guid') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/grocerylist/item/:guid";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/grocerylist/item/:guid
http DELETE {{baseUrl}}/grocerylist/item/:guid
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/grocerylist/item/:guid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/grocerylist/item/:guid")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Add a single line item to the grocery list (POST)
{{baseUrl}}/grocerylist/line
BODY json
{
"text": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/grocerylist/line");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"text\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/grocerylist/line" {:content-type :json
:form-params {:text ""}})
require "http/client"
url = "{{baseUrl}}/grocerylist/line"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"text\": \"\"\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}}/grocerylist/line"),
Content = new StringContent("{\n \"text\": \"\"\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}}/grocerylist/line");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"text\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/grocerylist/line"
payload := strings.NewReader("{\n \"text\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/grocerylist/line HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"text": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/grocerylist/line")
.setHeader("content-type", "application/json")
.setBody("{\n \"text\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/grocerylist/line"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"text\": \"\"\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 \"text\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/grocerylist/line")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/grocerylist/line")
.header("content-type", "application/json")
.body("{\n \"text\": \"\"\n}")
.asString();
const data = JSON.stringify({
text: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/grocerylist/line');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/line',
headers: {'content-type': 'application/json'},
data: {text: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/grocerylist/line';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"text":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/grocerylist/line',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "text": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"text\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/grocerylist/line")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/grocerylist/line',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({text: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/line',
headers: {'content-type': 'application/json'},
body: {text: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/grocerylist/line');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
text: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/line',
headers: {'content-type': 'application/json'},
data: {text: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/grocerylist/line';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"text":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"text": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/grocerylist/line"]
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}}/grocerylist/line" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"text\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/grocerylist/line",
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([
'text' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/grocerylist/line', [
'body' => '{
"text": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/grocerylist/line');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'text' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'text' => ''
]));
$request->setRequestUrl('{{baseUrl}}/grocerylist/line');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/grocerylist/line' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"text": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/grocerylist/line' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"text": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"text\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/grocerylist/line", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/grocerylist/line"
payload = { "text": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/grocerylist/line"
payload <- "{\n \"text\": \"\"\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}}/grocerylist/line")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"text\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/grocerylist/line') do |req|
req.body = "{\n \"text\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/grocerylist/line";
let payload = json!({"text": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/grocerylist/line \
--header 'content-type: application/json' \
--data '{
"text": ""
}'
echo '{
"text": ""
}' | \
http POST {{baseUrl}}/grocerylist/line \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "text": ""\n}' \
--output-document \
- {{baseUrl}}/grocerylist/line
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["text": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/grocerylist/line")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Add a single line item to the grocery list
{{baseUrl}}/grocerylist/item
BODY json
{
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/grocerylist/item");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/grocerylist/item" {:content-type :json
:form-params {:department ""
:name ""
:notes ""
:quantity ""
:unit ""}})
require "http/client"
url = "{{baseUrl}}/grocerylist/item"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\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}}/grocerylist/item"),
Content = new StringContent("{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\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}}/grocerylist/item");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/grocerylist/item"
payload := strings.NewReader("{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/grocerylist/item HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 83
{
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/grocerylist/item")
.setHeader("content-type", "application/json")
.setBody("{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/grocerylist/item"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\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 \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/grocerylist/item")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/grocerylist/item")
.header("content-type", "application/json")
.body("{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}")
.asString();
const data = JSON.stringify({
department: '',
name: '',
notes: '',
quantity: '',
unit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/grocerylist/item');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/item',
headers: {'content-type': 'application/json'},
data: {department: '', name: '', notes: '', quantity: '', unit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/grocerylist/item';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"department":"","name":"","notes":"","quantity":"","unit":""}'
};
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}}/grocerylist/item',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "department": "",\n "name": "",\n "notes": "",\n "quantity": "",\n "unit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/grocerylist/item")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/grocerylist/item',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({department: '', name: '', notes: '', quantity: '', unit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/item',
headers: {'content-type': 'application/json'},
body: {department: '', name: '', notes: '', quantity: '', unit: ''},
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}}/grocerylist/item');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
department: '',
name: '',
notes: '',
quantity: '',
unit: ''
});
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}}/grocerylist/item',
headers: {'content-type': 'application/json'},
data: {department: '', name: '', notes: '', quantity: '', unit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/grocerylist/item';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"department":"","name":"","notes":"","quantity":"","unit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"department": @"",
@"name": @"",
@"notes": @"",
@"quantity": @"",
@"unit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/grocerylist/item"]
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}}/grocerylist/item" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/grocerylist/item",
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([
'department' => '',
'name' => '',
'notes' => '',
'quantity' => '',
'unit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/grocerylist/item', [
'body' => '{
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/grocerylist/item');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'department' => '',
'name' => '',
'notes' => '',
'quantity' => '',
'unit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'department' => '',
'name' => '',
'notes' => '',
'quantity' => '',
'unit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/grocerylist/item');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/grocerylist/item' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/grocerylist/item' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/grocerylist/item", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/grocerylist/item"
payload = {
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/grocerylist/item"
payload <- "{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\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}}/grocerylist/item")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/grocerylist/item') do |req|
req.body = "{\n \"department\": \"\",\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/grocerylist/item";
let payload = json!({
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/grocerylist/item \
--header 'content-type: application/json' \
--data '{
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}'
echo '{
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}' | \
http POST {{baseUrl}}/grocerylist/item \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "department": "",\n "name": "",\n "notes": "",\n "quantity": "",\n "unit": ""\n}' \
--output-document \
- {{baseUrl}}/grocerylist/item
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"department": "",
"name": "",
"notes": "",
"quantity": "",
"unit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/grocerylist/item")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Clears the checked lines.
{{baseUrl}}/grocerylist/clearcheckedlines
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/grocerylist/clearcheckedlines");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/grocerylist/clearcheckedlines")
require "http/client"
url = "{{baseUrl}}/grocerylist/clearcheckedlines"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/grocerylist/clearcheckedlines"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/grocerylist/clearcheckedlines");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/grocerylist/clearcheckedlines"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/grocerylist/clearcheckedlines HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/grocerylist/clearcheckedlines")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/grocerylist/clearcheckedlines"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/grocerylist/clearcheckedlines")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/grocerylist/clearcheckedlines")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/grocerylist/clearcheckedlines');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/clearcheckedlines'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/grocerylist/clearcheckedlines';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/grocerylist/clearcheckedlines',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/grocerylist/clearcheckedlines")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/grocerylist/clearcheckedlines',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/clearcheckedlines'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/grocerylist/clearcheckedlines');
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}}/grocerylist/clearcheckedlines'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/grocerylist/clearcheckedlines';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/grocerylist/clearcheckedlines"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/grocerylist/clearcheckedlines" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/grocerylist/clearcheckedlines",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/grocerylist/clearcheckedlines');
echo $response->getBody();
setUrl('{{baseUrl}}/grocerylist/clearcheckedlines');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/grocerylist/clearcheckedlines');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/grocerylist/clearcheckedlines' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/grocerylist/clearcheckedlines' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/grocerylist/clearcheckedlines")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/grocerylist/clearcheckedlines"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/grocerylist/clearcheckedlines"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/grocerylist/clearcheckedlines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/grocerylist/clearcheckedlines') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/grocerylist/clearcheckedlines";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/grocerylist/clearcheckedlines
http POST {{baseUrl}}/grocerylist/clearcheckedlines
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/grocerylist/clearcheckedlines
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/grocerylist/clearcheckedlines")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete all the items on a grocery list; faster operation than a sync with deleted items.
{{baseUrl}}/grocerylist
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/grocerylist");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/grocerylist")
require "http/client"
url = "{{baseUrl}}/grocerylist"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/grocerylist"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/grocerylist");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/grocerylist"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/grocerylist HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/grocerylist")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/grocerylist"))
.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}}/grocerylist")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/grocerylist")
.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}}/grocerylist');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/grocerylist'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/grocerylist';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/grocerylist',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/grocerylist")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/grocerylist',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'DELETE', url: '{{baseUrl}}/grocerylist'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/grocerylist');
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}}/grocerylist'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/grocerylist';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/grocerylist"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/grocerylist" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/grocerylist",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/grocerylist');
echo $response->getBody();
setUrl('{{baseUrl}}/grocerylist');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/grocerylist');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/grocerylist' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/grocerylist' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/grocerylist")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/grocerylist"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/grocerylist"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/grocerylist")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/grocerylist') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/grocerylist";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/grocerylist
http DELETE {{baseUrl}}/grocerylist
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/grocerylist
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/grocerylist")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Departmentalize a list of strings -- used for ad-hoc grocery list item addition
{{baseUrl}}/grocerylist/department
BODY json
{
"items": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/grocerylist/department");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"items\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/grocerylist/department" {:content-type :json
:form-params {:items ""}})
require "http/client"
url = "{{baseUrl}}/grocerylist/department"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"items\": \"\"\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}}/grocerylist/department"),
Content = new StringContent("{\n \"items\": \"\"\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}}/grocerylist/department");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"items\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/grocerylist/department"
payload := strings.NewReader("{\n \"items\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/grocerylist/department HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 17
{
"items": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/grocerylist/department")
.setHeader("content-type", "application/json")
.setBody("{\n \"items\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/grocerylist/department"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"items\": \"\"\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 \"items\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/grocerylist/department")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/grocerylist/department")
.header("content-type", "application/json")
.body("{\n \"items\": \"\"\n}")
.asString();
const data = JSON.stringify({
items: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/grocerylist/department');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/department',
headers: {'content-type': 'application/json'},
data: {items: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/grocerylist/department';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"items":""}'
};
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}}/grocerylist/department',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "items": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"items\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/grocerylist/department")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/grocerylist/department',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({items: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/department',
headers: {'content-type': 'application/json'},
body: {items: ''},
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}}/grocerylist/department');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
items: ''
});
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}}/grocerylist/department',
headers: {'content-type': 'application/json'},
data: {items: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/grocerylist/department';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"items":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"items": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/grocerylist/department"]
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}}/grocerylist/department" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"items\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/grocerylist/department",
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([
'items' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/grocerylist/department', [
'body' => '{
"items": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/grocerylist/department');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'items' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'items' => ''
]));
$request->setRequestUrl('{{baseUrl}}/grocerylist/department');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/grocerylist/department' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"items": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/grocerylist/department' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"items": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"items\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/grocerylist/department", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/grocerylist/department"
payload = { "items": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/grocerylist/department"
payload <- "{\n \"items\": \"\"\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}}/grocerylist/department")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"items\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/grocerylist/department') do |req|
req.body = "{\n \"items\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/grocerylist/department";
let payload = json!({"items": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/grocerylist/department \
--header 'content-type: application/json' \
--data '{
"items": ""
}'
echo '{
"items": ""
}' | \
http POST {{baseUrl}}/grocerylist/department \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "items": ""\n}' \
--output-document \
- {{baseUrl}}/grocerylist/department
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["items": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/grocerylist/department")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get the user's grocery list. User is determined by Basic Authentication.
{{baseUrl}}/grocerylist
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/grocerylist");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/grocerylist")
require "http/client"
url = "{{baseUrl}}/grocerylist"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/grocerylist"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/grocerylist");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/grocerylist"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/grocerylist HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/grocerylist")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/grocerylist"))
.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}}/grocerylist")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/grocerylist")
.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}}/grocerylist');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/grocerylist'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/grocerylist';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/grocerylist',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/grocerylist")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/grocerylist',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/grocerylist'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/grocerylist');
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}}/grocerylist'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/grocerylist';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/grocerylist"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/grocerylist" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/grocerylist",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/grocerylist');
echo $response->getBody();
setUrl('{{baseUrl}}/grocerylist');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/grocerylist');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/grocerylist' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/grocerylist' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/grocerylist")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/grocerylist"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/grocerylist"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/grocerylist")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/grocerylist') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/grocerylist";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/grocerylist
http GET {{baseUrl}}/grocerylist
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/grocerylist
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/grocerylist")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Synchronize the grocery list. Call this with a POST to -grocerylist-sync
{{baseUrl}}/grocerylist/sync
BODY json
{
"list": {
"Items": [
{
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": false,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
}
],
"LastModified": "",
"Recipes": [
{
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": false,
"HeroPhotoUrl": "",
"HideFromPublicSearch": false,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": false,
"IsPrivate": false,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
}
],
"VersionGuid": ""
},
"since": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/grocerylist/sync");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/grocerylist/sync" {:content-type :json
:form-params {:list {:Items [{:BigOvenObject ""
:CreationDate ""
:Department ""
:DisplayQuantity ""
:GUID ""
:IsChecked false
:ItemID 0
:LastModified ""
:LocalStatus ""
:Name ""
:Notes ""
:RecipeID 0
:ThirdPartyURL ""}]
:LastModified ""
:Recipes [{:BookmarkURL ""
:Category ""
:CreationDate ""
:Cuisine ""
:HasVideos false
:HeroPhotoUrl ""
:HideFromPublicSearch false
:ImageURL ""
:ImageURL120 ""
:IsBookmark false
:IsPrivate false
:MaxImageSquare 0
:Microcategory ""
:Poster {:FirstName ""
:ImageUrl48 ""
:IsKitchenHelper false
:IsPremium false
:IsUsingRecurly false
:LastName ""
:MemberSince ""
:PhotoUrl ""
:PhotoUrl48 ""
:PremiumExpiryDate ""
:UserID 0
:UserName ""
:WebUrl ""}
:QualityScore ""
:RecipeID 0
:ReviewCount 0
:StarRating ""
:StarRatingIMG ""
:Subcategory ""
:Title ""
:TotalTries 0
:WebURL ""
:YieldNumber ""}]
:VersionGuid ""}
:since ""}})
require "http/client"
url = "{{baseUrl}}/grocerylist/sync"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\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}}/grocerylist/sync"),
Content = new StringContent("{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\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}}/grocerylist/sync");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/grocerylist/sync"
payload := strings.NewReader("{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/grocerylist/sync HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1507
{
"list": {
"Items": [
{
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": false,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
}
],
"LastModified": "",
"Recipes": [
{
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": false,
"HeroPhotoUrl": "",
"HideFromPublicSearch": false,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": false,
"IsPrivate": false,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
}
],
"VersionGuid": ""
},
"since": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/grocerylist/sync")
.setHeader("content-type", "application/json")
.setBody("{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/grocerylist/sync"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\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 \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/grocerylist/sync")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/grocerylist/sync")
.header("content-type", "application/json")
.body("{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}")
.asString();
const data = JSON.stringify({
list: {
Items: [
{
BigOvenObject: '',
CreationDate: '',
Department: '',
DisplayQuantity: '',
GUID: '',
IsChecked: false,
ItemID: 0,
LastModified: '',
LocalStatus: '',
Name: '',
Notes: '',
RecipeID: 0,
ThirdPartyURL: ''
}
],
LastModified: '',
Recipes: [
{
BookmarkURL: '',
Category: '',
CreationDate: '',
Cuisine: '',
HasVideos: false,
HeroPhotoUrl: '',
HideFromPublicSearch: false,
ImageURL: '',
ImageURL120: '',
IsBookmark: false,
IsPrivate: false,
MaxImageSquare: 0,
Microcategory: '',
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
QualityScore: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
StarRatingIMG: '',
Subcategory: '',
Title: '',
TotalTries: 0,
WebURL: '',
YieldNumber: ''
}
],
VersionGuid: ''
},
since: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/grocerylist/sync');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/sync',
headers: {'content-type': 'application/json'},
data: {
list: {
Items: [
{
BigOvenObject: '',
CreationDate: '',
Department: '',
DisplayQuantity: '',
GUID: '',
IsChecked: false,
ItemID: 0,
LastModified: '',
LocalStatus: '',
Name: '',
Notes: '',
RecipeID: 0,
ThirdPartyURL: ''
}
],
LastModified: '',
Recipes: [
{
BookmarkURL: '',
Category: '',
CreationDate: '',
Cuisine: '',
HasVideos: false,
HeroPhotoUrl: '',
HideFromPublicSearch: false,
ImageURL: '',
ImageURL120: '',
IsBookmark: false,
IsPrivate: false,
MaxImageSquare: 0,
Microcategory: '',
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
QualityScore: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
StarRatingIMG: '',
Subcategory: '',
Title: '',
TotalTries: 0,
WebURL: '',
YieldNumber: ''
}
],
VersionGuid: ''
},
since: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/grocerylist/sync';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"list":{"Items":[{"BigOvenObject":"","CreationDate":"","Department":"","DisplayQuantity":"","GUID":"","IsChecked":false,"ItemID":0,"LastModified":"","LocalStatus":"","Name":"","Notes":"","RecipeID":0,"ThirdPartyURL":""}],"LastModified":"","Recipes":[{"BookmarkURL":"","Category":"","CreationDate":"","Cuisine":"","HasVideos":false,"HeroPhotoUrl":"","HideFromPublicSearch":false,"ImageURL":"","ImageURL120":"","IsBookmark":false,"IsPrivate":false,"MaxImageSquare":0,"Microcategory":"","Poster":{"FirstName":"","ImageUrl48":"","IsKitchenHelper":false,"IsPremium":false,"IsUsingRecurly":false,"LastName":"","MemberSince":"","PhotoUrl":"","PhotoUrl48":"","PremiumExpiryDate":"","UserID":0,"UserName":"","WebUrl":""},"QualityScore":"","RecipeID":0,"ReviewCount":0,"StarRating":"","StarRatingIMG":"","Subcategory":"","Title":"","TotalTries":0,"WebURL":"","YieldNumber":""}],"VersionGuid":""},"since":""}'
};
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}}/grocerylist/sync',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "list": {\n "Items": [\n {\n "BigOvenObject": "",\n "CreationDate": "",\n "Department": "",\n "DisplayQuantity": "",\n "GUID": "",\n "IsChecked": false,\n "ItemID": 0,\n "LastModified": "",\n "LocalStatus": "",\n "Name": "",\n "Notes": "",\n "RecipeID": 0,\n "ThirdPartyURL": ""\n }\n ],\n "LastModified": "",\n "Recipes": [\n {\n "BookmarkURL": "",\n "Category": "",\n "CreationDate": "",\n "Cuisine": "",\n "HasVideos": false,\n "HeroPhotoUrl": "",\n "HideFromPublicSearch": false,\n "ImageURL": "",\n "ImageURL120": "",\n "IsBookmark": false,\n "IsPrivate": false,\n "MaxImageSquare": 0,\n "Microcategory": "",\n "Poster": {\n "FirstName": "",\n "ImageUrl48": "",\n "IsKitchenHelper": false,\n "IsPremium": false,\n "IsUsingRecurly": false,\n "LastName": "",\n "MemberSince": "",\n "PhotoUrl": "",\n "PhotoUrl48": "",\n "PremiumExpiryDate": "",\n "UserID": 0,\n "UserName": "",\n "WebUrl": ""\n },\n "QualityScore": "",\n "RecipeID": 0,\n "ReviewCount": 0,\n "StarRating": "",\n "StarRatingIMG": "",\n "Subcategory": "",\n "Title": "",\n "TotalTries": 0,\n "WebURL": "",\n "YieldNumber": ""\n }\n ],\n "VersionGuid": ""\n },\n "since": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/grocerylist/sync")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/grocerylist/sync',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
list: {
Items: [
{
BigOvenObject: '',
CreationDate: '',
Department: '',
DisplayQuantity: '',
GUID: '',
IsChecked: false,
ItemID: 0,
LastModified: '',
LocalStatus: '',
Name: '',
Notes: '',
RecipeID: 0,
ThirdPartyURL: ''
}
],
LastModified: '',
Recipes: [
{
BookmarkURL: '',
Category: '',
CreationDate: '',
Cuisine: '',
HasVideos: false,
HeroPhotoUrl: '',
HideFromPublicSearch: false,
ImageURL: '',
ImageURL120: '',
IsBookmark: false,
IsPrivate: false,
MaxImageSquare: 0,
Microcategory: '',
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
QualityScore: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
StarRatingIMG: '',
Subcategory: '',
Title: '',
TotalTries: 0,
WebURL: '',
YieldNumber: ''
}
],
VersionGuid: ''
},
since: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/grocerylist/sync',
headers: {'content-type': 'application/json'},
body: {
list: {
Items: [
{
BigOvenObject: '',
CreationDate: '',
Department: '',
DisplayQuantity: '',
GUID: '',
IsChecked: false,
ItemID: 0,
LastModified: '',
LocalStatus: '',
Name: '',
Notes: '',
RecipeID: 0,
ThirdPartyURL: ''
}
],
LastModified: '',
Recipes: [
{
BookmarkURL: '',
Category: '',
CreationDate: '',
Cuisine: '',
HasVideos: false,
HeroPhotoUrl: '',
HideFromPublicSearch: false,
ImageURL: '',
ImageURL120: '',
IsBookmark: false,
IsPrivate: false,
MaxImageSquare: 0,
Microcategory: '',
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
QualityScore: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
StarRatingIMG: '',
Subcategory: '',
Title: '',
TotalTries: 0,
WebURL: '',
YieldNumber: ''
}
],
VersionGuid: ''
},
since: ''
},
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}}/grocerylist/sync');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
list: {
Items: [
{
BigOvenObject: '',
CreationDate: '',
Department: '',
DisplayQuantity: '',
GUID: '',
IsChecked: false,
ItemID: 0,
LastModified: '',
LocalStatus: '',
Name: '',
Notes: '',
RecipeID: 0,
ThirdPartyURL: ''
}
],
LastModified: '',
Recipes: [
{
BookmarkURL: '',
Category: '',
CreationDate: '',
Cuisine: '',
HasVideos: false,
HeroPhotoUrl: '',
HideFromPublicSearch: false,
ImageURL: '',
ImageURL120: '',
IsBookmark: false,
IsPrivate: false,
MaxImageSquare: 0,
Microcategory: '',
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
QualityScore: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
StarRatingIMG: '',
Subcategory: '',
Title: '',
TotalTries: 0,
WebURL: '',
YieldNumber: ''
}
],
VersionGuid: ''
},
since: ''
});
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}}/grocerylist/sync',
headers: {'content-type': 'application/json'},
data: {
list: {
Items: [
{
BigOvenObject: '',
CreationDate: '',
Department: '',
DisplayQuantity: '',
GUID: '',
IsChecked: false,
ItemID: 0,
LastModified: '',
LocalStatus: '',
Name: '',
Notes: '',
RecipeID: 0,
ThirdPartyURL: ''
}
],
LastModified: '',
Recipes: [
{
BookmarkURL: '',
Category: '',
CreationDate: '',
Cuisine: '',
HasVideos: false,
HeroPhotoUrl: '',
HideFromPublicSearch: false,
ImageURL: '',
ImageURL120: '',
IsBookmark: false,
IsPrivate: false,
MaxImageSquare: 0,
Microcategory: '',
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
QualityScore: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
StarRatingIMG: '',
Subcategory: '',
Title: '',
TotalTries: 0,
WebURL: '',
YieldNumber: ''
}
],
VersionGuid: ''
},
since: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/grocerylist/sync';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"list":{"Items":[{"BigOvenObject":"","CreationDate":"","Department":"","DisplayQuantity":"","GUID":"","IsChecked":false,"ItemID":0,"LastModified":"","LocalStatus":"","Name":"","Notes":"","RecipeID":0,"ThirdPartyURL":""}],"LastModified":"","Recipes":[{"BookmarkURL":"","Category":"","CreationDate":"","Cuisine":"","HasVideos":false,"HeroPhotoUrl":"","HideFromPublicSearch":false,"ImageURL":"","ImageURL120":"","IsBookmark":false,"IsPrivate":false,"MaxImageSquare":0,"Microcategory":"","Poster":{"FirstName":"","ImageUrl48":"","IsKitchenHelper":false,"IsPremium":false,"IsUsingRecurly":false,"LastName":"","MemberSince":"","PhotoUrl":"","PhotoUrl48":"","PremiumExpiryDate":"","UserID":0,"UserName":"","WebUrl":""},"QualityScore":"","RecipeID":0,"ReviewCount":0,"StarRating":"","StarRatingIMG":"","Subcategory":"","Title":"","TotalTries":0,"WebURL":"","YieldNumber":""}],"VersionGuid":""},"since":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"list": @{ @"Items": @[ @{ @"BigOvenObject": @"", @"CreationDate": @"", @"Department": @"", @"DisplayQuantity": @"", @"GUID": @"", @"IsChecked": @NO, @"ItemID": @0, @"LastModified": @"", @"LocalStatus": @"", @"Name": @"", @"Notes": @"", @"RecipeID": @0, @"ThirdPartyURL": @"" } ], @"LastModified": @"", @"Recipes": @[ @{ @"BookmarkURL": @"", @"Category": @"", @"CreationDate": @"", @"Cuisine": @"", @"HasVideos": @NO, @"HeroPhotoUrl": @"", @"HideFromPublicSearch": @NO, @"ImageURL": @"", @"ImageURL120": @"", @"IsBookmark": @NO, @"IsPrivate": @NO, @"MaxImageSquare": @0, @"Microcategory": @"", @"Poster": @{ @"FirstName": @"", @"ImageUrl48": @"", @"IsKitchenHelper": @NO, @"IsPremium": @NO, @"IsUsingRecurly": @NO, @"LastName": @"", @"MemberSince": @"", @"PhotoUrl": @"", @"PhotoUrl48": @"", @"PremiumExpiryDate": @"", @"UserID": @0, @"UserName": @"", @"WebUrl": @"" }, @"QualityScore": @"", @"RecipeID": @0, @"ReviewCount": @0, @"StarRating": @"", @"StarRatingIMG": @"", @"Subcategory": @"", @"Title": @"", @"TotalTries": @0, @"WebURL": @"", @"YieldNumber": @"" } ], @"VersionGuid": @"" },
@"since": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/grocerylist/sync"]
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}}/grocerylist/sync" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/grocerylist/sync",
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([
'list' => [
'Items' => [
[
'BigOvenObject' => '',
'CreationDate' => '',
'Department' => '',
'DisplayQuantity' => '',
'GUID' => '',
'IsChecked' => null,
'ItemID' => 0,
'LastModified' => '',
'LocalStatus' => '',
'Name' => '',
'Notes' => '',
'RecipeID' => 0,
'ThirdPartyURL' => ''
]
],
'LastModified' => '',
'Recipes' => [
[
'BookmarkURL' => '',
'Category' => '',
'CreationDate' => '',
'Cuisine' => '',
'HasVideos' => null,
'HeroPhotoUrl' => '',
'HideFromPublicSearch' => null,
'ImageURL' => '',
'ImageURL120' => '',
'IsBookmark' => null,
'IsPrivate' => null,
'MaxImageSquare' => 0,
'Microcategory' => '',
'Poster' => [
'FirstName' => '',
'ImageUrl48' => '',
'IsKitchenHelper' => null,
'IsPremium' => null,
'IsUsingRecurly' => null,
'LastName' => '',
'MemberSince' => '',
'PhotoUrl' => '',
'PhotoUrl48' => '',
'PremiumExpiryDate' => '',
'UserID' => 0,
'UserName' => '',
'WebUrl' => ''
],
'QualityScore' => '',
'RecipeID' => 0,
'ReviewCount' => 0,
'StarRating' => '',
'StarRatingIMG' => '',
'Subcategory' => '',
'Title' => '',
'TotalTries' => 0,
'WebURL' => '',
'YieldNumber' => ''
]
],
'VersionGuid' => ''
],
'since' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/grocerylist/sync', [
'body' => '{
"list": {
"Items": [
{
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": false,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
}
],
"LastModified": "",
"Recipes": [
{
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": false,
"HeroPhotoUrl": "",
"HideFromPublicSearch": false,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": false,
"IsPrivate": false,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
}
],
"VersionGuid": ""
},
"since": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/grocerylist/sync');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'list' => [
'Items' => [
[
'BigOvenObject' => '',
'CreationDate' => '',
'Department' => '',
'DisplayQuantity' => '',
'GUID' => '',
'IsChecked' => null,
'ItemID' => 0,
'LastModified' => '',
'LocalStatus' => '',
'Name' => '',
'Notes' => '',
'RecipeID' => 0,
'ThirdPartyURL' => ''
]
],
'LastModified' => '',
'Recipes' => [
[
'BookmarkURL' => '',
'Category' => '',
'CreationDate' => '',
'Cuisine' => '',
'HasVideos' => null,
'HeroPhotoUrl' => '',
'HideFromPublicSearch' => null,
'ImageURL' => '',
'ImageURL120' => '',
'IsBookmark' => null,
'IsPrivate' => null,
'MaxImageSquare' => 0,
'Microcategory' => '',
'Poster' => [
'FirstName' => '',
'ImageUrl48' => '',
'IsKitchenHelper' => null,
'IsPremium' => null,
'IsUsingRecurly' => null,
'LastName' => '',
'MemberSince' => '',
'PhotoUrl' => '',
'PhotoUrl48' => '',
'PremiumExpiryDate' => '',
'UserID' => 0,
'UserName' => '',
'WebUrl' => ''
],
'QualityScore' => '',
'RecipeID' => 0,
'ReviewCount' => 0,
'StarRating' => '',
'StarRatingIMG' => '',
'Subcategory' => '',
'Title' => '',
'TotalTries' => 0,
'WebURL' => '',
'YieldNumber' => ''
]
],
'VersionGuid' => ''
],
'since' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'list' => [
'Items' => [
[
'BigOvenObject' => '',
'CreationDate' => '',
'Department' => '',
'DisplayQuantity' => '',
'GUID' => '',
'IsChecked' => null,
'ItemID' => 0,
'LastModified' => '',
'LocalStatus' => '',
'Name' => '',
'Notes' => '',
'RecipeID' => 0,
'ThirdPartyURL' => ''
]
],
'LastModified' => '',
'Recipes' => [
[
'BookmarkURL' => '',
'Category' => '',
'CreationDate' => '',
'Cuisine' => '',
'HasVideos' => null,
'HeroPhotoUrl' => '',
'HideFromPublicSearch' => null,
'ImageURL' => '',
'ImageURL120' => '',
'IsBookmark' => null,
'IsPrivate' => null,
'MaxImageSquare' => 0,
'Microcategory' => '',
'Poster' => [
'FirstName' => '',
'ImageUrl48' => '',
'IsKitchenHelper' => null,
'IsPremium' => null,
'IsUsingRecurly' => null,
'LastName' => '',
'MemberSince' => '',
'PhotoUrl' => '',
'PhotoUrl48' => '',
'PremiumExpiryDate' => '',
'UserID' => 0,
'UserName' => '',
'WebUrl' => ''
],
'QualityScore' => '',
'RecipeID' => 0,
'ReviewCount' => 0,
'StarRating' => '',
'StarRatingIMG' => '',
'Subcategory' => '',
'Title' => '',
'TotalTries' => 0,
'WebURL' => '',
'YieldNumber' => ''
]
],
'VersionGuid' => ''
],
'since' => ''
]));
$request->setRequestUrl('{{baseUrl}}/grocerylist/sync');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/grocerylist/sync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"list": {
"Items": [
{
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": false,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
}
],
"LastModified": "",
"Recipes": [
{
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": false,
"HeroPhotoUrl": "",
"HideFromPublicSearch": false,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": false,
"IsPrivate": false,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
}
],
"VersionGuid": ""
},
"since": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/grocerylist/sync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"list": {
"Items": [
{
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": false,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
}
],
"LastModified": "",
"Recipes": [
{
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": false,
"HeroPhotoUrl": "",
"HideFromPublicSearch": false,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": false,
"IsPrivate": false,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
}
],
"VersionGuid": ""
},
"since": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/grocerylist/sync", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/grocerylist/sync"
payload = {
"list": {
"Items": [
{
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": False,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
}
],
"LastModified": "",
"Recipes": [
{
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": False,
"HeroPhotoUrl": "",
"HideFromPublicSearch": False,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": False,
"IsPrivate": False,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": False,
"IsPremium": False,
"IsUsingRecurly": False,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
}
],
"VersionGuid": ""
},
"since": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/grocerylist/sync"
payload <- "{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\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}}/grocerylist/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/grocerylist/sync') do |req|
req.body = "{\n \"list\": {\n \"Items\": [\n {\n \"BigOvenObject\": \"\",\n \"CreationDate\": \"\",\n \"Department\": \"\",\n \"DisplayQuantity\": \"\",\n \"GUID\": \"\",\n \"IsChecked\": false,\n \"ItemID\": 0,\n \"LastModified\": \"\",\n \"LocalStatus\": \"\",\n \"Name\": \"\",\n \"Notes\": \"\",\n \"RecipeID\": 0,\n \"ThirdPartyURL\": \"\"\n }\n ],\n \"LastModified\": \"\",\n \"Recipes\": [\n {\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"HasVideos\": false,\n \"HeroPhotoUrl\": \"\",\n \"HideFromPublicSearch\": false,\n \"ImageURL\": \"\",\n \"ImageURL120\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"MaxImageSquare\": 0,\n \"Microcategory\": \"\",\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"QualityScore\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"StarRatingIMG\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalTries\": 0,\n \"WebURL\": \"\",\n \"YieldNumber\": \"\"\n }\n ],\n \"VersionGuid\": \"\"\n },\n \"since\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/grocerylist/sync";
let payload = json!({
"list": json!({
"Items": (
json!({
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": false,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
})
),
"LastModified": "",
"Recipes": (
json!({
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": false,
"HeroPhotoUrl": "",
"HideFromPublicSearch": false,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": false,
"IsPrivate": false,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": json!({
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
}),
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
})
),
"VersionGuid": ""
}),
"since": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/grocerylist/sync \
--header 'content-type: application/json' \
--data '{
"list": {
"Items": [
{
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": false,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
}
],
"LastModified": "",
"Recipes": [
{
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": false,
"HeroPhotoUrl": "",
"HideFromPublicSearch": false,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": false,
"IsPrivate": false,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
}
],
"VersionGuid": ""
},
"since": ""
}'
echo '{
"list": {
"Items": [
{
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": false,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
}
],
"LastModified": "",
"Recipes": [
{
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": false,
"HeroPhotoUrl": "",
"HideFromPublicSearch": false,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": false,
"IsPrivate": false,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
}
],
"VersionGuid": ""
},
"since": ""
}' | \
http POST {{baseUrl}}/grocerylist/sync \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "list": {\n "Items": [\n {\n "BigOvenObject": "",\n "CreationDate": "",\n "Department": "",\n "DisplayQuantity": "",\n "GUID": "",\n "IsChecked": false,\n "ItemID": 0,\n "LastModified": "",\n "LocalStatus": "",\n "Name": "",\n "Notes": "",\n "RecipeID": 0,\n "ThirdPartyURL": ""\n }\n ],\n "LastModified": "",\n "Recipes": [\n {\n "BookmarkURL": "",\n "Category": "",\n "CreationDate": "",\n "Cuisine": "",\n "HasVideos": false,\n "HeroPhotoUrl": "",\n "HideFromPublicSearch": false,\n "ImageURL": "",\n "ImageURL120": "",\n "IsBookmark": false,\n "IsPrivate": false,\n "MaxImageSquare": 0,\n "Microcategory": "",\n "Poster": {\n "FirstName": "",\n "ImageUrl48": "",\n "IsKitchenHelper": false,\n "IsPremium": false,\n "IsUsingRecurly": false,\n "LastName": "",\n "MemberSince": "",\n "PhotoUrl": "",\n "PhotoUrl48": "",\n "PremiumExpiryDate": "",\n "UserID": 0,\n "UserName": "",\n "WebUrl": ""\n },\n "QualityScore": "",\n "RecipeID": 0,\n "ReviewCount": 0,\n "StarRating": "",\n "StarRatingIMG": "",\n "Subcategory": "",\n "Title": "",\n "TotalTries": 0,\n "WebURL": "",\n "YieldNumber": ""\n }\n ],\n "VersionGuid": ""\n },\n "since": ""\n}' \
--output-document \
- {{baseUrl}}/grocerylist/sync
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"list": [
"Items": [
[
"BigOvenObject": "",
"CreationDate": "",
"Department": "",
"DisplayQuantity": "",
"GUID": "",
"IsChecked": false,
"ItemID": 0,
"LastModified": "",
"LocalStatus": "",
"Name": "",
"Notes": "",
"RecipeID": 0,
"ThirdPartyURL": ""
]
],
"LastModified": "",
"Recipes": [
[
"BookmarkURL": "",
"Category": "",
"CreationDate": "",
"Cuisine": "",
"HasVideos": false,
"HeroPhotoUrl": "",
"HideFromPublicSearch": false,
"ImageURL": "",
"ImageURL120": "",
"IsBookmark": false,
"IsPrivate": false,
"MaxImageSquare": 0,
"Microcategory": "",
"Poster": [
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
],
"QualityScore": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"StarRatingIMG": "",
"Subcategory": "",
"Title": "",
"TotalTries": 0,
"WebURL": "",
"YieldNumber": ""
]
],
"VersionGuid": ""
],
"since": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/grocerylist/sync")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Update a grocery item by GUID
{{baseUrl}}/grocerylist/item/:guid
QUERY PARAMS
guid
BODY json
{
"department": "",
"guid": "",
"ischecked": false,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/grocerylist/item/:guid");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/grocerylist/item/:guid" {:content-type :json
:form-params {:department ""
:guid ""
:ischecked false
:name ""
:notes ""
:quantity ""
:unit ""}})
require "http/client"
url = "{{baseUrl}}/grocerylist/item/:guid"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/grocerylist/item/:guid"),
Content = new StringContent("{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\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}}/grocerylist/item/:guid");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/grocerylist/item/:guid"
payload := strings.NewReader("{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/grocerylist/item/:guid HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 119
{
"department": "",
"guid": "",
"ischecked": false,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/grocerylist/item/:guid")
.setHeader("content-type", "application/json")
.setBody("{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/grocerylist/item/:guid"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\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 \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/grocerylist/item/:guid")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/grocerylist/item/:guid")
.header("content-type", "application/json")
.body("{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}")
.asString();
const data = JSON.stringify({
department: '',
guid: '',
ischecked: false,
name: '',
notes: '',
quantity: '',
unit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/grocerylist/item/:guid');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/grocerylist/item/:guid',
headers: {'content-type': 'application/json'},
data: {
department: '',
guid: '',
ischecked: false,
name: '',
notes: '',
quantity: '',
unit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/grocerylist/item/:guid';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"department":"","guid":"","ischecked":false,"name":"","notes":"","quantity":"","unit":""}'
};
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}}/grocerylist/item/:guid',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "department": "",\n "guid": "",\n "ischecked": false,\n "name": "",\n "notes": "",\n "quantity": "",\n "unit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/grocerylist/item/:guid")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/grocerylist/item/:guid',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
department: '',
guid: '',
ischecked: false,
name: '',
notes: '',
quantity: '',
unit: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/grocerylist/item/:guid',
headers: {'content-type': 'application/json'},
body: {
department: '',
guid: '',
ischecked: false,
name: '',
notes: '',
quantity: '',
unit: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/grocerylist/item/:guid');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
department: '',
guid: '',
ischecked: false,
name: '',
notes: '',
quantity: '',
unit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/grocerylist/item/:guid',
headers: {'content-type': 'application/json'},
data: {
department: '',
guid: '',
ischecked: false,
name: '',
notes: '',
quantity: '',
unit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/grocerylist/item/:guid';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"department":"","guid":"","ischecked":false,"name":"","notes":"","quantity":"","unit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"department": @"",
@"guid": @"",
@"ischecked": @NO,
@"name": @"",
@"notes": @"",
@"quantity": @"",
@"unit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/grocerylist/item/:guid"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/grocerylist/item/:guid" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/grocerylist/item/:guid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'department' => '',
'guid' => '',
'ischecked' => null,
'name' => '',
'notes' => '',
'quantity' => '',
'unit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/grocerylist/item/:guid', [
'body' => '{
"department": "",
"guid": "",
"ischecked": false,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/grocerylist/item/:guid');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'department' => '',
'guid' => '',
'ischecked' => null,
'name' => '',
'notes' => '',
'quantity' => '',
'unit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'department' => '',
'guid' => '',
'ischecked' => null,
'name' => '',
'notes' => '',
'quantity' => '',
'unit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/grocerylist/item/:guid');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/grocerylist/item/:guid' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"department": "",
"guid": "",
"ischecked": false,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/grocerylist/item/:guid' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"department": "",
"guid": "",
"ischecked": false,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/grocerylist/item/:guid", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/grocerylist/item/:guid"
payload = {
"department": "",
"guid": "",
"ischecked": False,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/grocerylist/item/:guid"
payload <- "{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/grocerylist/item/:guid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/grocerylist/item/:guid') do |req|
req.body = "{\n \"department\": \"\",\n \"guid\": \"\",\n \"ischecked\": false,\n \"name\": \"\",\n \"notes\": \"\",\n \"quantity\": \"\",\n \"unit\": \"\"\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}}/grocerylist/item/:guid";
let payload = json!({
"department": "",
"guid": "",
"ischecked": false,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/grocerylist/item/:guid \
--header 'content-type: application/json' \
--data '{
"department": "",
"guid": "",
"ischecked": false,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}'
echo '{
"department": "",
"guid": "",
"ischecked": false,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
}' | \
http PUT {{baseUrl}}/grocerylist/item/:guid \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "department": "",\n "guid": "",\n "ischecked": false,\n "name": "",\n "notes": "",\n "quantity": "",\n "unit": ""\n}' \
--output-document \
- {{baseUrl}}/grocerylist/item/:guid
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"department": "",
"guid": "",
"ischecked": false,
"name": "",
"notes": "",
"quantity": "",
"unit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/grocerylist/item/:guid")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get all the images for a recipe. DEPRECATED. Please use -recipe-{recipeId}-photos.
{{baseUrl}}/recipe/:recipeId/images
QUERY PARAMS
recipeId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/images");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:recipeId/images")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/images"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/images"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/images");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/images"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:recipeId/images HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:recipeId/images")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/images"))
.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}}/recipe/:recipeId/images")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:recipeId/images")
.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}}/recipe/:recipeId/images');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/images'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/images';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/images',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/images")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/images',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/images'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:recipeId/images');
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}}/recipe/:recipeId/images'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/images';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/images"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/images" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/images",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:recipeId/images');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/images');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/images');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/images' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/images' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:recipeId/images")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/images"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/images"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/images")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:recipeId/images') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/images";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:recipeId/images
http GET {{baseUrl}}/recipe/:recipeId/images
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:recipeId/images
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/images")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get all the photos for a recipe
{{baseUrl}}/recipe/:recipeId/photos
QUERY PARAMS
recipeId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/photos");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:recipeId/photos")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/photos"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/photos"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/photos");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/photos"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:recipeId/photos HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:recipeId/photos")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/photos"))
.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}}/recipe/:recipeId/photos")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:recipeId/photos")
.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}}/recipe/:recipeId/photos');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/photos'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/photos';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/photos',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/photos")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/photos',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/photos'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:recipeId/photos');
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}}/recipe/:recipeId/photos'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/photos';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/photos"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/photos" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/photos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:recipeId/photos');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/photos');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/photos');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/photos' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/photos' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:recipeId/photos")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/photos"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/photos"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/photos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:recipeId/photos') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/photos";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:recipeId/photos
http GET {{baseUrl}}/recipe/:recipeId/photos
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:recipeId/photos
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/photos")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Gets a list of RecipeScan images for the recipe. There will be at most 3 per recipe.
{{baseUrl}}/recipe/:recipeId/scans
QUERY PARAMS
recipeId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/scans");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:recipeId/scans")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/scans"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/scans"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/scans");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/scans"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:recipeId/scans HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:recipeId/scans")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/scans"))
.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}}/recipe/:recipeId/scans")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:recipeId/scans")
.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}}/recipe/:recipeId/scans');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/scans'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/scans';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/scans',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/scans")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/scans',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/scans'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:recipeId/scans');
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}}/recipe/:recipeId/scans'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/scans';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/scans"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/scans" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/scans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:recipeId/scans');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/scans');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/scans');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/scans' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/scans' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:recipeId/scans")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/scans"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/scans"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:recipeId/scans') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/scans";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:recipeId/scans
http GET {{baseUrl}}/recipe/:recipeId/scans
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:recipeId/scans
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/scans")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Gets the pending by user.
{{baseUrl}}/recipe/photos/pending
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/photos/pending");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/photos/pending")
require "http/client"
url = "{{baseUrl}}/recipe/photos/pending"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/photos/pending"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/photos/pending");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/photos/pending"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/photos/pending HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/photos/pending")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/photos/pending"))
.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}}/recipe/photos/pending")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/photos/pending")
.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}}/recipe/photos/pending');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/photos/pending'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/photos/pending';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/photos/pending',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/photos/pending")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/photos/pending',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/photos/pending'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/photos/pending');
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}}/recipe/photos/pending'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/photos/pending';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/photos/pending"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/photos/pending" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/photos/pending",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/photos/pending');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/photos/pending');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/photos/pending');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/photos/pending' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/photos/pending' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/photos/pending")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/photos/pending"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/photos/pending"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/photos/pending")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/photos/pending') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/photos/pending";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/photos/pending
http GET {{baseUrl}}/recipe/photos/pending
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/photos/pending
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/photos/pending")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Gets the options.
{{baseUrl}}/me/preferences/options
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/me/preferences/options");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/me/preferences/options")
require "http/client"
url = "{{baseUrl}}/me/preferences/options"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/me/preferences/options"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/me/preferences/options");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/me/preferences/options"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/me/preferences/options HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/me/preferences/options")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/me/preferences/options"))
.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}}/me/preferences/options")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/me/preferences/options")
.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}}/me/preferences/options');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/me/preferences/options'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/me/preferences/options';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/me/preferences/options',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/me/preferences/options")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/me/preferences/options',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/me/preferences/options'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/me/preferences/options');
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}}/me/preferences/options'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/me/preferences/options';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/me/preferences/options"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/me/preferences/options" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/me/preferences/options",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/me/preferences/options');
echo $response->getBody();
setUrl('{{baseUrl}}/me/preferences/options');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/me/preferences/options');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/me/preferences/options' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/me/preferences/options' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/me/preferences/options")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/me/preferences/options"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/me/preferences/options"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/me/preferences/options")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/me/preferences/options') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/me/preferences/options";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/me/preferences/options
http GET {{baseUrl}}/me/preferences/options
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/me/preferences/options
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/me/preferences/options")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Indexes this instance.
{{baseUrl}}/me
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/me");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/me")
require "http/client"
url = "{{baseUrl}}/me"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/me"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/me");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/me"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/me HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/me")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/me"))
.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}}/me")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/me")
.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}}/me');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/me'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/me';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/me',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/me")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/me',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/me'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/me');
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}}/me'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/me';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/me"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/me" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/me');
echo $response->getBody();
setUrl('{{baseUrl}}/me');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/me');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/me' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/me' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/me")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/me"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/me"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/me') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/me";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/me
http GET {{baseUrl}}/me
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/me
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/me")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Puts me personal.
{{baseUrl}}/me/personal
BODY json
{
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/me/personal");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/me/personal" {:content-type :json
:form-params {:Email ""
:Location {:City ""
:Country ""
:DMA 0}}})
require "http/client"
url = "{{baseUrl}}/me/personal"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/me/personal"),
Content = new StringContent("{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\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}}/me/personal");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/me/personal"
payload := strings.NewReader("{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/me/personal HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 86
{
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/me/personal")
.setHeader("content-type", "application/json")
.setBody("{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/me/personal"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\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 \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/me/personal")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/me/personal")
.header("content-type", "application/json")
.body("{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}")
.asString();
const data = JSON.stringify({
Email: '',
Location: {
City: '',
Country: '',
DMA: 0
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/me/personal');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/me/personal',
headers: {'content-type': 'application/json'},
data: {Email: '', Location: {City: '', Country: '', DMA: 0}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/me/personal';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"Email":"","Location":{"City":"","Country":"","DMA":0}}'
};
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}}/me/personal',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "Email": "",\n "Location": {\n "City": "",\n "Country": "",\n "DMA": 0\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 \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/me/personal")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/me/personal',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({Email: '', Location: {City: '', Country: '', DMA: 0}}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/me/personal',
headers: {'content-type': 'application/json'},
body: {Email: '', Location: {City: '', Country: '', DMA: 0}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/me/personal');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
Email: '',
Location: {
City: '',
Country: '',
DMA: 0
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/me/personal',
headers: {'content-type': 'application/json'},
data: {Email: '', Location: {City: '', Country: '', DMA: 0}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/me/personal';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"Email":"","Location":{"City":"","Country":"","DMA":0}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Email": @"",
@"Location": @{ @"City": @"", @"Country": @"", @"DMA": @0 } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/me/personal"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/me/personal" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/me/personal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'Email' => '',
'Location' => [
'City' => '',
'Country' => '',
'DMA' => 0
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/me/personal', [
'body' => '{
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/me/personal');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Email' => '',
'Location' => [
'City' => '',
'Country' => '',
'DMA' => 0
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Email' => '',
'Location' => [
'City' => '',
'Country' => '',
'DMA' => 0
]
]));
$request->setRequestUrl('{{baseUrl}}/me/personal');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/me/personal' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/me/personal' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/me/personal", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/me/personal"
payload = {
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/me/personal"
payload <- "{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/me/personal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/me/personal') do |req|
req.body = "{\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\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}}/me/personal";
let payload = json!({
"Email": "",
"Location": json!({
"City": "",
"Country": "",
"DMA": 0
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/me/personal \
--header 'content-type: application/json' \
--data '{
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
}'
echo '{
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
}' | \
http PUT {{baseUrl}}/me/personal \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "Email": "",\n "Location": {\n "City": "",\n "Country": "",\n "DMA": 0\n }\n}' \
--output-document \
- {{baseUrl}}/me/personal
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"Email": "",
"Location": [
"City": "",
"Country": "",
"DMA": 0
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/me/personal")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Puts me preferences.
{{baseUrl}}/me/preferences
BODY json
{
"EatingStyle": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/me/preferences");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EatingStyle\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/me/preferences" {:content-type :json
:form-params {:EatingStyle ""}})
require "http/client"
url = "{{baseUrl}}/me/preferences"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"EatingStyle\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/me/preferences"),
Content = new StringContent("{\n \"EatingStyle\": \"\"\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}}/me/preferences");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EatingStyle\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/me/preferences"
payload := strings.NewReader("{\n \"EatingStyle\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/me/preferences HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"EatingStyle": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/me/preferences")
.setHeader("content-type", "application/json")
.setBody("{\n \"EatingStyle\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/me/preferences"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"EatingStyle\": \"\"\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 \"EatingStyle\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/me/preferences")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/me/preferences")
.header("content-type", "application/json")
.body("{\n \"EatingStyle\": \"\"\n}")
.asString();
const data = JSON.stringify({
EatingStyle: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/me/preferences');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/me/preferences',
headers: {'content-type': 'application/json'},
data: {EatingStyle: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/me/preferences';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"EatingStyle":""}'
};
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}}/me/preferences',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "EatingStyle": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EatingStyle\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/me/preferences")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/me/preferences',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({EatingStyle: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/me/preferences',
headers: {'content-type': 'application/json'},
body: {EatingStyle: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/me/preferences');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
EatingStyle: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/me/preferences',
headers: {'content-type': 'application/json'},
data: {EatingStyle: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/me/preferences';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"EatingStyle":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EatingStyle": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/me/preferences"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/me/preferences" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"EatingStyle\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/me/preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'EatingStyle' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/me/preferences', [
'body' => '{
"EatingStyle": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/me/preferences');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EatingStyle' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EatingStyle' => ''
]));
$request->setRequestUrl('{{baseUrl}}/me/preferences');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/me/preferences' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"EatingStyle": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/me/preferences' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"EatingStyle": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EatingStyle\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/me/preferences", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/me/preferences"
payload = { "EatingStyle": "" }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/me/preferences"
payload <- "{\n \"EatingStyle\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/me/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"EatingStyle\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/me/preferences') do |req|
req.body = "{\n \"EatingStyle\": \"\"\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}}/me/preferences";
let payload = json!({"EatingStyle": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/me/preferences \
--header 'content-type: application/json' \
--data '{
"EatingStyle": ""
}'
echo '{
"EatingStyle": ""
}' | \
http PUT {{baseUrl}}/me/preferences \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "EatingStyle": ""\n}' \
--output-document \
- {{baseUrl}}/me/preferences
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["EatingStyle": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/me/preferences")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Puts me. (PUT)
{{baseUrl}}/me/profile
BODY json
{
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/me/profile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/me/profile" {:content-type :json
:form-params {:AboutMe ""
:BackgroundUrl ""
:Counts {:AddedCount 0
:FollowersCount 0
:FollowingCount 0
:PrivateRecipeCount 0
:PublicRecipeCount 0
:TotalRecipes 0}
:FirstName ""
:FullName ""
:HomeUrl ""
:LastName ""
:PhotoUrl ""
:UserID 0
:UserName ""}})
require "http/client"
url = "{{baseUrl}}/me/profile"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/me/profile"),
Content = new StringContent("{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\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}}/me/profile");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/me/profile"
payload := strings.NewReader("{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/me/profile HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 334
{
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/me/profile")
.setHeader("content-type", "application/json")
.setBody("{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/me/profile"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\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 \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/me/profile")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/me/profile")
.header("content-type", "application/json")
.body("{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}")
.asString();
const data = JSON.stringify({
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/me/profile');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/me/profile',
headers: {'content-type': 'application/json'},
data: {
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/me/profile';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"AboutMe":"","BackgroundUrl":"","Counts":{"AddedCount":0,"FollowersCount":0,"FollowingCount":0,"PrivateRecipeCount":0,"PublicRecipeCount":0,"TotalRecipes":0},"FirstName":"","FullName":"","HomeUrl":"","LastName":"","PhotoUrl":"","UserID":0,"UserName":""}'
};
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}}/me/profile',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AboutMe": "",\n "BackgroundUrl": "",\n "Counts": {\n "AddedCount": 0,\n "FollowersCount": 0,\n "FollowingCount": 0,\n "PrivateRecipeCount": 0,\n "PublicRecipeCount": 0,\n "TotalRecipes": 0\n },\n "FirstName": "",\n "FullName": "",\n "HomeUrl": "",\n "LastName": "",\n "PhotoUrl": "",\n "UserID": 0,\n "UserName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/me/profile")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/me/profile',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/me/profile',
headers: {'content-type': 'application/json'},
body: {
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/me/profile');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/me/profile',
headers: {'content-type': 'application/json'},
data: {
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/me/profile';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"AboutMe":"","BackgroundUrl":"","Counts":{"AddedCount":0,"FollowersCount":0,"FollowingCount":0,"PrivateRecipeCount":0,"PublicRecipeCount":0,"TotalRecipes":0},"FirstName":"","FullName":"","HomeUrl":"","LastName":"","PhotoUrl":"","UserID":0,"UserName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AboutMe": @"",
@"BackgroundUrl": @"",
@"Counts": @{ @"AddedCount": @0, @"FollowersCount": @0, @"FollowingCount": @0, @"PrivateRecipeCount": @0, @"PublicRecipeCount": @0, @"TotalRecipes": @0 },
@"FirstName": @"",
@"FullName": @"",
@"HomeUrl": @"",
@"LastName": @"",
@"PhotoUrl": @"",
@"UserID": @0,
@"UserName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/me/profile"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/me/profile" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/me/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'AboutMe' => '',
'BackgroundUrl' => '',
'Counts' => [
'AddedCount' => 0,
'FollowersCount' => 0,
'FollowingCount' => 0,
'PrivateRecipeCount' => 0,
'PublicRecipeCount' => 0,
'TotalRecipes' => 0
],
'FirstName' => '',
'FullName' => '',
'HomeUrl' => '',
'LastName' => '',
'PhotoUrl' => '',
'UserID' => 0,
'UserName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/me/profile', [
'body' => '{
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/me/profile');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AboutMe' => '',
'BackgroundUrl' => '',
'Counts' => [
'AddedCount' => 0,
'FollowersCount' => 0,
'FollowingCount' => 0,
'PrivateRecipeCount' => 0,
'PublicRecipeCount' => 0,
'TotalRecipes' => 0
],
'FirstName' => '',
'FullName' => '',
'HomeUrl' => '',
'LastName' => '',
'PhotoUrl' => '',
'UserID' => 0,
'UserName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AboutMe' => '',
'BackgroundUrl' => '',
'Counts' => [
'AddedCount' => 0,
'FollowersCount' => 0,
'FollowingCount' => 0,
'PrivateRecipeCount' => 0,
'PublicRecipeCount' => 0,
'TotalRecipes' => 0
],
'FirstName' => '',
'FullName' => '',
'HomeUrl' => '',
'LastName' => '',
'PhotoUrl' => '',
'UserID' => 0,
'UserName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/me/profile');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/me/profile' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/me/profile' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/me/profile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/me/profile"
payload = {
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/me/profile"
payload <- "{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/me/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/me/profile') do |req|
req.body = "{\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\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}}/me/profile";
let payload = json!({
"AboutMe": "",
"BackgroundUrl": "",
"Counts": json!({
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
}),
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/me/profile \
--header 'content-type: application/json' \
--data '{
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}'
echo '{
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}' | \
http PUT {{baseUrl}}/me/profile \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "AboutMe": "",\n "BackgroundUrl": "",\n "Counts": {\n "AddedCount": 0,\n "FollowersCount": 0,\n "FollowingCount": 0,\n "PrivateRecipeCount": 0,\n "PublicRecipeCount": 0,\n "TotalRecipes": 0\n },\n "FirstName": "",\n "FullName": "",\n "HomeUrl": "",\n "LastName": "",\n "PhotoUrl": "",\n "UserID": 0,\n "UserName": ""\n}' \
--output-document \
- {{baseUrl}}/me/profile
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AboutMe": "",
"BackgroundUrl": "",
"Counts": [
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
],
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/me/profile")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Puts me.
{{baseUrl}}/me
BODY json
{
"Accounting": {
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
},
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": {
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
},
"Preferences": {
"EatingStyle": ""
},
"Profile": {
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/me");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/me" {:content-type :json
:form-params {:Accounting {:CreditBalance 0
:MemberSince ""
:PremiumExpiryDate ""
:UserLevel ""}
:BOAuthToken ""
:LastChangeLogID ""
:Personal {:Email ""
:Location {:City ""
:Country ""
:DMA 0}}
:Preferences {:EatingStyle ""}
:Profile {:AboutMe ""
:BackgroundUrl ""
:Counts {:AddedCount 0
:FollowersCount 0
:FollowingCount 0
:PrivateRecipeCount 0
:PublicRecipeCount 0
:TotalRecipes 0}
:FirstName ""
:FullName ""
:HomeUrl ""
:LastName ""
:PhotoUrl ""
:UserID 0
:UserName ""}}})
require "http/client"
url = "{{baseUrl}}/me"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/me"),
Content = new StringContent("{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\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}}/me");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/me"
payload := strings.NewReader("{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/me HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 714
{
"Accounting": {
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
},
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": {
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
},
"Preferences": {
"EatingStyle": ""
},
"Profile": {
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/me")
.setHeader("content-type", "application/json")
.setBody("{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/me"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\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 \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/me")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/me")
.header("content-type", "application/json")
.body("{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
Accounting: {
CreditBalance: 0,
MemberSince: '',
PremiumExpiryDate: '',
UserLevel: ''
},
BOAuthToken: '',
LastChangeLogID: '',
Personal: {
Email: '',
Location: {
City: '',
Country: '',
DMA: 0
}
},
Preferences: {
EatingStyle: ''
},
Profile: {
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/me');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/me',
headers: {'content-type': 'application/json'},
data: {
Accounting: {CreditBalance: 0, MemberSince: '', PremiumExpiryDate: '', UserLevel: ''},
BOAuthToken: '',
LastChangeLogID: '',
Personal: {Email: '', Location: {City: '', Country: '', DMA: 0}},
Preferences: {EatingStyle: ''},
Profile: {
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/me';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"Accounting":{"CreditBalance":0,"MemberSince":"","PremiumExpiryDate":"","UserLevel":""},"BOAuthToken":"","LastChangeLogID":"","Personal":{"Email":"","Location":{"City":"","Country":"","DMA":0}},"Preferences":{"EatingStyle":""},"Profile":{"AboutMe":"","BackgroundUrl":"","Counts":{"AddedCount":0,"FollowersCount":0,"FollowingCount":0,"PrivateRecipeCount":0,"PublicRecipeCount":0,"TotalRecipes":0},"FirstName":"","FullName":"","HomeUrl":"","LastName":"","PhotoUrl":"","UserID":0,"UserName":""}}'
};
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}}/me',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "Accounting": {\n "CreditBalance": 0,\n "MemberSince": "",\n "PremiumExpiryDate": "",\n "UserLevel": ""\n },\n "BOAuthToken": "",\n "LastChangeLogID": "",\n "Personal": {\n "Email": "",\n "Location": {\n "City": "",\n "Country": "",\n "DMA": 0\n }\n },\n "Preferences": {\n "EatingStyle": ""\n },\n "Profile": {\n "AboutMe": "",\n "BackgroundUrl": "",\n "Counts": {\n "AddedCount": 0,\n "FollowersCount": 0,\n "FollowingCount": 0,\n "PrivateRecipeCount": 0,\n "PublicRecipeCount": 0,\n "TotalRecipes": 0\n },\n "FirstName": "",\n "FullName": "",\n "HomeUrl": "",\n "LastName": "",\n "PhotoUrl": "",\n "UserID": 0,\n "UserName": ""\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 \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/me")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/me',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
Accounting: {CreditBalance: 0, MemberSince: '', PremiumExpiryDate: '', UserLevel: ''},
BOAuthToken: '',
LastChangeLogID: '',
Personal: {Email: '', Location: {City: '', Country: '', DMA: 0}},
Preferences: {EatingStyle: ''},
Profile: {
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/me',
headers: {'content-type': 'application/json'},
body: {
Accounting: {CreditBalance: 0, MemberSince: '', PremiumExpiryDate: '', UserLevel: ''},
BOAuthToken: '',
LastChangeLogID: '',
Personal: {Email: '', Location: {City: '', Country: '', DMA: 0}},
Preferences: {EatingStyle: ''},
Profile: {
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/me');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
Accounting: {
CreditBalance: 0,
MemberSince: '',
PremiumExpiryDate: '',
UserLevel: ''
},
BOAuthToken: '',
LastChangeLogID: '',
Personal: {
Email: '',
Location: {
City: '',
Country: '',
DMA: 0
}
},
Preferences: {
EatingStyle: ''
},
Profile: {
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/me',
headers: {'content-type': 'application/json'},
data: {
Accounting: {CreditBalance: 0, MemberSince: '', PremiumExpiryDate: '', UserLevel: ''},
BOAuthToken: '',
LastChangeLogID: '',
Personal: {Email: '', Location: {City: '', Country: '', DMA: 0}},
Preferences: {EatingStyle: ''},
Profile: {
AboutMe: '',
BackgroundUrl: '',
Counts: {
AddedCount: 0,
FollowersCount: 0,
FollowingCount: 0,
PrivateRecipeCount: 0,
PublicRecipeCount: 0,
TotalRecipes: 0
},
FirstName: '',
FullName: '',
HomeUrl: '',
LastName: '',
PhotoUrl: '',
UserID: 0,
UserName: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/me';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"Accounting":{"CreditBalance":0,"MemberSince":"","PremiumExpiryDate":"","UserLevel":""},"BOAuthToken":"","LastChangeLogID":"","Personal":{"Email":"","Location":{"City":"","Country":"","DMA":0}},"Preferences":{"EatingStyle":""},"Profile":{"AboutMe":"","BackgroundUrl":"","Counts":{"AddedCount":0,"FollowersCount":0,"FollowingCount":0,"PrivateRecipeCount":0,"PublicRecipeCount":0,"TotalRecipes":0},"FirstName":"","FullName":"","HomeUrl":"","LastName":"","PhotoUrl":"","UserID":0,"UserName":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Accounting": @{ @"CreditBalance": @0, @"MemberSince": @"", @"PremiumExpiryDate": @"", @"UserLevel": @"" },
@"BOAuthToken": @"",
@"LastChangeLogID": @"",
@"Personal": @{ @"Email": @"", @"Location": @{ @"City": @"", @"Country": @"", @"DMA": @0 } },
@"Preferences": @{ @"EatingStyle": @"" },
@"Profile": @{ @"AboutMe": @"", @"BackgroundUrl": @"", @"Counts": @{ @"AddedCount": @0, @"FollowersCount": @0, @"FollowingCount": @0, @"PrivateRecipeCount": @0, @"PublicRecipeCount": @0, @"TotalRecipes": @0 }, @"FirstName": @"", @"FullName": @"", @"HomeUrl": @"", @"LastName": @"", @"PhotoUrl": @"", @"UserID": @0, @"UserName": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/me"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/me" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'Accounting' => [
'CreditBalance' => 0,
'MemberSince' => '',
'PremiumExpiryDate' => '',
'UserLevel' => ''
],
'BOAuthToken' => '',
'LastChangeLogID' => '',
'Personal' => [
'Email' => '',
'Location' => [
'City' => '',
'Country' => '',
'DMA' => 0
]
],
'Preferences' => [
'EatingStyle' => ''
],
'Profile' => [
'AboutMe' => '',
'BackgroundUrl' => '',
'Counts' => [
'AddedCount' => 0,
'FollowersCount' => 0,
'FollowingCount' => 0,
'PrivateRecipeCount' => 0,
'PublicRecipeCount' => 0,
'TotalRecipes' => 0
],
'FirstName' => '',
'FullName' => '',
'HomeUrl' => '',
'LastName' => '',
'PhotoUrl' => '',
'UserID' => 0,
'UserName' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/me', [
'body' => '{
"Accounting": {
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
},
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": {
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
},
"Preferences": {
"EatingStyle": ""
},
"Profile": {
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/me');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Accounting' => [
'CreditBalance' => 0,
'MemberSince' => '',
'PremiumExpiryDate' => '',
'UserLevel' => ''
],
'BOAuthToken' => '',
'LastChangeLogID' => '',
'Personal' => [
'Email' => '',
'Location' => [
'City' => '',
'Country' => '',
'DMA' => 0
]
],
'Preferences' => [
'EatingStyle' => ''
],
'Profile' => [
'AboutMe' => '',
'BackgroundUrl' => '',
'Counts' => [
'AddedCount' => 0,
'FollowersCount' => 0,
'FollowingCount' => 0,
'PrivateRecipeCount' => 0,
'PublicRecipeCount' => 0,
'TotalRecipes' => 0
],
'FirstName' => '',
'FullName' => '',
'HomeUrl' => '',
'LastName' => '',
'PhotoUrl' => '',
'UserID' => 0,
'UserName' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Accounting' => [
'CreditBalance' => 0,
'MemberSince' => '',
'PremiumExpiryDate' => '',
'UserLevel' => ''
],
'BOAuthToken' => '',
'LastChangeLogID' => '',
'Personal' => [
'Email' => '',
'Location' => [
'City' => '',
'Country' => '',
'DMA' => 0
]
],
'Preferences' => [
'EatingStyle' => ''
],
'Profile' => [
'AboutMe' => '',
'BackgroundUrl' => '',
'Counts' => [
'AddedCount' => 0,
'FollowersCount' => 0,
'FollowingCount' => 0,
'PrivateRecipeCount' => 0,
'PublicRecipeCount' => 0,
'TotalRecipes' => 0
],
'FirstName' => '',
'FullName' => '',
'HomeUrl' => '',
'LastName' => '',
'PhotoUrl' => '',
'UserID' => 0,
'UserName' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/me');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/me' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"Accounting": {
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
},
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": {
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
},
"Preferences": {
"EatingStyle": ""
},
"Profile": {
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/me' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"Accounting": {
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
},
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": {
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
},
"Preferences": {
"EatingStyle": ""
},
"Profile": {
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/me", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/me"
payload = {
"Accounting": {
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
},
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": {
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
},
"Preferences": { "EatingStyle": "" },
"Profile": {
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/me"
payload <- "{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/me') do |req|
req.body = "{\n \"Accounting\": {\n \"CreditBalance\": 0,\n \"MemberSince\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserLevel\": \"\"\n },\n \"BOAuthToken\": \"\",\n \"LastChangeLogID\": \"\",\n \"Personal\": {\n \"Email\": \"\",\n \"Location\": {\n \"City\": \"\",\n \"Country\": \"\",\n \"DMA\": 0\n }\n },\n \"Preferences\": {\n \"EatingStyle\": \"\"\n },\n \"Profile\": {\n \"AboutMe\": \"\",\n \"BackgroundUrl\": \"\",\n \"Counts\": {\n \"AddedCount\": 0,\n \"FollowersCount\": 0,\n \"FollowingCount\": 0,\n \"PrivateRecipeCount\": 0,\n \"PublicRecipeCount\": 0,\n \"TotalRecipes\": 0\n },\n \"FirstName\": \"\",\n \"FullName\": \"\",\n \"HomeUrl\": \"\",\n \"LastName\": \"\",\n \"PhotoUrl\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\"\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}}/me";
let payload = json!({
"Accounting": json!({
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
}),
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": json!({
"Email": "",
"Location": json!({
"City": "",
"Country": "",
"DMA": 0
})
}),
"Preferences": json!({"EatingStyle": ""}),
"Profile": json!({
"AboutMe": "",
"BackgroundUrl": "",
"Counts": json!({
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
}),
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/me \
--header 'content-type: application/json' \
--data '{
"Accounting": {
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
},
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": {
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
},
"Preferences": {
"EatingStyle": ""
},
"Profile": {
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
}'
echo '{
"Accounting": {
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
},
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": {
"Email": "",
"Location": {
"City": "",
"Country": "",
"DMA": 0
}
},
"Preferences": {
"EatingStyle": ""
},
"Profile": {
"AboutMe": "",
"BackgroundUrl": "",
"Counts": {
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
},
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
}
}' | \
http PUT {{baseUrl}}/me \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "Accounting": {\n "CreditBalance": 0,\n "MemberSince": "",\n "PremiumExpiryDate": "",\n "UserLevel": ""\n },\n "BOAuthToken": "",\n "LastChangeLogID": "",\n "Personal": {\n "Email": "",\n "Location": {\n "City": "",\n "Country": "",\n "DMA": 0\n }\n },\n "Preferences": {\n "EatingStyle": ""\n },\n "Profile": {\n "AboutMe": "",\n "BackgroundUrl": "",\n "Counts": {\n "AddedCount": 0,\n "FollowersCount": 0,\n "FollowingCount": 0,\n "PrivateRecipeCount": 0,\n "PublicRecipeCount": 0,\n "TotalRecipes": 0\n },\n "FirstName": "",\n "FullName": "",\n "HomeUrl": "",\n "LastName": "",\n "PhotoUrl": "",\n "UserID": 0,\n "UserName": ""\n }\n}' \
--output-document \
- {{baseUrl}}/me
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"Accounting": [
"CreditBalance": 0,
"MemberSince": "",
"PremiumExpiryDate": "",
"UserLevel": ""
],
"BOAuthToken": "",
"LastChangeLogID": "",
"Personal": [
"Email": "",
"Location": [
"City": "",
"Country": "",
"DMA": 0
]
],
"Preferences": ["EatingStyle": ""],
"Profile": [
"AboutMe": "",
"BackgroundUrl": "",
"Counts": [
"AddedCount": 0,
"FollowersCount": 0,
"FollowingCount": 0,
"PrivateRecipeCount": 0,
"PublicRecipeCount": 0,
"TotalRecipes": 0
],
"FirstName": "",
"FullName": "",
"HomeUrl": "",
"LastName": "",
"PhotoUrl": "",
"UserID": 0,
"UserName": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/me")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Skinnies this instance.
{{baseUrl}}/me/skinny
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/me/skinny");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/me/skinny")
require "http/client"
url = "{{baseUrl}}/me/skinny"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/me/skinny"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/me/skinny");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/me/skinny"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/me/skinny HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/me/skinny")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/me/skinny"))
.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}}/me/skinny")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/me/skinny")
.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}}/me/skinny');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/me/skinny'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/me/skinny';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/me/skinny',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/me/skinny")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/me/skinny',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/me/skinny'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/me/skinny');
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}}/me/skinny'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/me/skinny';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/me/skinny"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/me/skinny" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/me/skinny",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/me/skinny');
echo $response->getBody();
setUrl('{{baseUrl}}/me/skinny');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/me/skinny');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/me/skinny' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/me/skinny' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/me/skinny")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/me/skinny"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/me/skinny"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/me/skinny")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/me/skinny') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/me/skinny";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/me/skinny
http GET {{baseUrl}}/me/skinny
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/me/skinny
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/me/skinny")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete a review do a DELETE Http request of -note-{ID}
{{baseUrl}}/recipe/:recipeId/note/:noteId
QUERY PARAMS
recipeId
noteId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/note/:noteId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/recipe/:recipeId/note/:noteId")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/note/:noteId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/note/:noteId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/note/:noteId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/note/:noteId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/recipe/:recipeId/note/:noteId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/recipe/:recipeId/note/:noteId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/note/:noteId"))
.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}}/recipe/:recipeId/note/:noteId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/recipe/:recipeId/note/:noteId")
.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}}/recipe/:recipeId/note/:noteId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/recipe/:recipeId/note/:noteId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/note/:noteId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/note/:noteId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/note/:noteId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/note/:noteId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/recipe/:recipeId/note/:noteId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/recipe/:recipeId/note/:noteId');
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}}/recipe/:recipeId/note/:noteId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/note/:noteId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/note/:noteId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/note/:noteId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/note/:noteId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/recipe/:recipeId/note/:noteId');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/note/:noteId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/note/:noteId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/note/:noteId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/note/:noteId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/recipe/:recipeId/note/:noteId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/note/:noteId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/note/:noteId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/note/:noteId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/recipe/:recipeId/note/:noteId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/note/:noteId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/recipe/:recipeId/note/:noteId
http DELETE {{baseUrl}}/recipe/:recipeId/note/:noteId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/recipe/:recipeId/note/:noteId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/note/:noteId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get a given note. Make sure you're passing authentication information in the header for the user who owns the note.
{{baseUrl}}/recipe/:recipeId/note/:noteId
QUERY PARAMS
recipeId
noteId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/note/:noteId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:recipeId/note/:noteId")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/note/:noteId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/note/:noteId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/note/:noteId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/note/:noteId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:recipeId/note/:noteId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:recipeId/note/:noteId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/note/:noteId"))
.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}}/recipe/:recipeId/note/:noteId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:recipeId/note/:noteId")
.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}}/recipe/:recipeId/note/:noteId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/:recipeId/note/:noteId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/note/:noteId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/note/:noteId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/note/:noteId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/note/:noteId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/:recipeId/note/:noteId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:recipeId/note/:noteId');
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}}/recipe/:recipeId/note/:noteId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/note/:noteId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/note/:noteId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/note/:noteId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/note/:noteId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:recipeId/note/:noteId');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/note/:noteId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/note/:noteId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/note/:noteId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/note/:noteId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:recipeId/note/:noteId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/note/:noteId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/note/:noteId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/note/:noteId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:recipeId/note/:noteId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/note/:noteId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:recipeId/note/:noteId
http GET {{baseUrl}}/recipe/:recipeId/note/:noteId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:recipeId/note/:noteId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/note/:noteId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
HTTP POST a new note into the system.
{{baseUrl}}/recipe/:recipeId/note
QUERY PARAMS
recipeId
BODY json
{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/note");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/recipe/:recipeId/note" {:content-type :json
:form-params {:CreationDate ""
:Date ""
:DateDT ""
:GUID ""
:ID 0
:Notes ""
:People ""
:RecipeID 0
:UserID 0
:Variations ""}})
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/note"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\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}}/recipe/:recipeId/note"),
Content = new StringContent("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\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}}/recipe/:recipeId/note");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/note"
payload := strings.NewReader("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/recipe/:recipeId/note HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 162
{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/recipe/:recipeId/note")
.setHeader("content-type", "application/json")
.setBody("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/note"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\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 \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/note")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/recipe/:recipeId/note")
.header("content-type", "application/json")
.body("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}")
.asString();
const data = JSON.stringify({
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/recipe/:recipeId/note');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/:recipeId/note',
headers: {'content-type': 'application/json'},
data: {
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/note';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"CreationDate":"","Date":"","DateDT":"","GUID":"","ID":0,"Notes":"","People":"","RecipeID":0,"UserID":0,"Variations":""}'
};
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}}/recipe/:recipeId/note',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "CreationDate": "",\n "Date": "",\n "DateDT": "",\n "GUID": "",\n "ID": 0,\n "Notes": "",\n "People": "",\n "RecipeID": 0,\n "UserID": 0,\n "Variations": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/note")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/note',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/:recipeId/note',
headers: {'content-type': 'application/json'},
body: {
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
},
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}}/recipe/:recipeId/note');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
});
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}}/recipe/:recipeId/note',
headers: {'content-type': 'application/json'},
data: {
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/note';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"CreationDate":"","Date":"","DateDT":"","GUID":"","ID":0,"Notes":"","People":"","RecipeID":0,"UserID":0,"Variations":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"CreationDate": @"",
@"Date": @"",
@"DateDT": @"",
@"GUID": @"",
@"ID": @0,
@"Notes": @"",
@"People": @"",
@"RecipeID": @0,
@"UserID": @0,
@"Variations": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/note"]
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}}/recipe/:recipeId/note" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/note",
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([
'CreationDate' => '',
'Date' => '',
'DateDT' => '',
'GUID' => '',
'ID' => 0,
'Notes' => '',
'People' => '',
'RecipeID' => 0,
'UserID' => 0,
'Variations' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/recipe/:recipeId/note', [
'body' => '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/note');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'CreationDate' => '',
'Date' => '',
'DateDT' => '',
'GUID' => '',
'ID' => 0,
'Notes' => '',
'People' => '',
'RecipeID' => 0,
'UserID' => 0,
'Variations' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'CreationDate' => '',
'Date' => '',
'DateDT' => '',
'GUID' => '',
'ID' => 0,
'Notes' => '',
'People' => '',
'RecipeID' => 0,
'UserID' => 0,
'Variations' => ''
]));
$request->setRequestUrl('{{baseUrl}}/recipe/:recipeId/note');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/note' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/note' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/recipe/:recipeId/note", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/note"
payload = {
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/note"
payload <- "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\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}}/recipe/:recipeId/note")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/recipe/:recipeId/note') do |req|
req.body = "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/note";
let payload = json!({
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/recipe/:recipeId/note \
--header 'content-type: application/json' \
--data '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}'
echo '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}' | \
http POST {{baseUrl}}/recipe/:recipeId/note \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "CreationDate": "",\n "Date": "",\n "DateDT": "",\n "GUID": "",\n "ID": 0,\n "Notes": "",\n "People": "",\n "RecipeID": 0,\n "UserID": 0,\n "Variations": ""\n}' \
--output-document \
- {{baseUrl}}/recipe/:recipeId/note
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/note")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
HTTP PUT (update) a Recipe note (RecipeNote).
{{baseUrl}}/recipe/:recipeId/note/:noteId
QUERY PARAMS
recipeId
noteId
BODY json
{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/note/:noteId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/recipe/:recipeId/note/:noteId" {:content-type :json
:form-params {:CreationDate ""
:Date ""
:DateDT ""
:GUID ""
:ID 0
:Notes ""
:People ""
:RecipeID 0
:UserID 0
:Variations ""}})
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/note/:noteId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/note/:noteId"),
Content = new StringContent("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\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}}/recipe/:recipeId/note/:noteId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/note/:noteId"
payload := strings.NewReader("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/recipe/:recipeId/note/:noteId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 162
{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/recipe/:recipeId/note/:noteId")
.setHeader("content-type", "application/json")
.setBody("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/note/:noteId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\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 \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/note/:noteId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/recipe/:recipeId/note/:noteId")
.header("content-type", "application/json")
.body("{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}")
.asString();
const data = JSON.stringify({
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/recipe/:recipeId/note/:noteId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/:recipeId/note/:noteId',
headers: {'content-type': 'application/json'},
data: {
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/note/:noteId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"CreationDate":"","Date":"","DateDT":"","GUID":"","ID":0,"Notes":"","People":"","RecipeID":0,"UserID":0,"Variations":""}'
};
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}}/recipe/:recipeId/note/:noteId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "CreationDate": "",\n "Date": "",\n "DateDT": "",\n "GUID": "",\n "ID": 0,\n "Notes": "",\n "People": "",\n "RecipeID": 0,\n "UserID": 0,\n "Variations": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/note/:noteId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/note/:noteId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/:recipeId/note/:noteId',
headers: {'content-type': 'application/json'},
body: {
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/recipe/:recipeId/note/:noteId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/:recipeId/note/:noteId',
headers: {'content-type': 'application/json'},
data: {
CreationDate: '',
Date: '',
DateDT: '',
GUID: '',
ID: 0,
Notes: '',
People: '',
RecipeID: 0,
UserID: 0,
Variations: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/note/:noteId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"CreationDate":"","Date":"","DateDT":"","GUID":"","ID":0,"Notes":"","People":"","RecipeID":0,"UserID":0,"Variations":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"CreationDate": @"",
@"Date": @"",
@"DateDT": @"",
@"GUID": @"",
@"ID": @0,
@"Notes": @"",
@"People": @"",
@"RecipeID": @0,
@"UserID": @0,
@"Variations": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/note/:noteId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/recipe/:recipeId/note/:noteId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/note/:noteId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'CreationDate' => '',
'Date' => '',
'DateDT' => '',
'GUID' => '',
'ID' => 0,
'Notes' => '',
'People' => '',
'RecipeID' => 0,
'UserID' => 0,
'Variations' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/recipe/:recipeId/note/:noteId', [
'body' => '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/note/:noteId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'CreationDate' => '',
'Date' => '',
'DateDT' => '',
'GUID' => '',
'ID' => 0,
'Notes' => '',
'People' => '',
'RecipeID' => 0,
'UserID' => 0,
'Variations' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'CreationDate' => '',
'Date' => '',
'DateDT' => '',
'GUID' => '',
'ID' => 0,
'Notes' => '',
'People' => '',
'RecipeID' => 0,
'UserID' => 0,
'Variations' => ''
]));
$request->setRequestUrl('{{baseUrl}}/recipe/:recipeId/note/:noteId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/note/:noteId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/note/:noteId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/recipe/:recipeId/note/:noteId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/note/:noteId"
payload = {
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/note/:noteId"
payload <- "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/note/:noteId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/recipe/:recipeId/note/:noteId') do |req|
req.body = "{\n \"CreationDate\": \"\",\n \"Date\": \"\",\n \"DateDT\": \"\",\n \"GUID\": \"\",\n \"ID\": 0,\n \"Notes\": \"\",\n \"People\": \"\",\n \"RecipeID\": 0,\n \"UserID\": 0,\n \"Variations\": \"\"\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}}/recipe/:recipeId/note/:noteId";
let payload = json!({
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/recipe/:recipeId/note/:noteId \
--header 'content-type: application/json' \
--data '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}'
echo '{
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
}' | \
http PUT {{baseUrl}}/recipe/:recipeId/note/:noteId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "CreationDate": "",\n "Date": "",\n "DateDT": "",\n "GUID": "",\n "ID": 0,\n "Notes": "",\n "People": "",\n "RecipeID": 0,\n "UserID": 0,\n "Variations": ""\n}' \
--output-document \
- {{baseUrl}}/recipe/:recipeId/note/:noteId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"CreationDate": "",
"Date": "",
"DateDT": "",
"GUID": "",
"ID": 0,
"Notes": "",
"People": "",
"RecipeID": 0,
"UserID": 0,
"Variations": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/note/:noteId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
recipe-100-notes
{{baseUrl}}/recipe/:recipeId/notes
QUERY PARAMS
recipeId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/notes");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:recipeId/notes")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/notes"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/notes"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/notes");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/notes"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:recipeId/notes HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:recipeId/notes")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/notes"))
.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}}/recipe/:recipeId/notes")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:recipeId/notes")
.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}}/recipe/:recipeId/notes');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/notes'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/notes';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/notes',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/notes")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/notes',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/notes'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:recipeId/notes');
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}}/recipe/:recipeId/notes'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/notes';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/notes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/notes" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/notes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:recipeId/notes');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/notes');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/notes');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/notes' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/notes' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:recipeId/notes")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/notes"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/notes"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/notes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:recipeId/notes') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/notes";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:recipeId/notes
http GET {{baseUrl}}/recipe/:recipeId/notes
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:recipeId/notes
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/notes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Add a new recipe
{{baseUrl}}/recipe
BODY json
{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/recipe" {:content-type :json
:form-params {:ActiveMinutes 0
:AdTags ""
:AdminBoost 0
:AllCategoriesText ""
:BookmarkImageURL ""
:BookmarkSiteLogo ""
:BookmarkURL ""
:Category ""
:Collection ""
:CollectionID 0
:CreationDate ""
:Cuisine ""
:Description ""
:FavoriteCount 0
:HeroPhotoUrl ""
:ImageSquares []
:ImageURL ""
:Ingredients [{:DisplayIndex 0
:DisplayQuantity ""
:HTMLName ""
:IngredientID 0
:IngredientInfo {:Department ""
:MasterIngredientID 0
:Name ""
:UsuallyOnHand false}
:IsHeading false
:IsLinked false
:MetricDisplayQuantity ""
:MetricQuantity ""
:MetricUnit ""
:Name ""
:PreparationNotes ""
:Quantity ""
:Unit ""}]
:IngredientsTextBlock ""
:Instructions ""
:IsBookmark false
:IsPrivate false
:IsRecipeScan false
:IsSponsored false
:LastModified ""
:MaxImageSquare 0
:MedalCount 0
:MenuCount 0
:Microcategory ""
:NotesCount 0
:NutritionInfo {:CaloriesFromFat ""
:Cholesterol ""
:CholesterolPct ""
:DietaryFiber ""
:DietaryFiberPct ""
:MonoFat ""
:PolyFat ""
:Potassium ""
:PotassiumPct ""
:Protein ""
:ProteinPct ""
:SatFat ""
:SatFatPct ""
:SingularYieldUnit ""
:Sodium ""
:SodiumPct ""
:Sugar ""
:TotalCalories ""
:TotalCarbs ""
:TotalCarbsPct ""
:TotalFat ""
:TotalFatPct ""
:TransFat ""}
:Poster {:FirstName ""
:ImageUrl48 ""
:IsKitchenHelper false
:IsPremium false
:IsUsingRecurly false
:LastName ""
:MemberSince ""
:PhotoUrl ""
:PhotoUrl48 ""
:PremiumExpiryDate ""
:UserID 0
:UserName ""
:WebUrl ""}
:PrimaryIngredient ""
:RecipeID 0
:ReviewCount 0
:StarRating ""
:Subcategory ""
:Title ""
:TotalMinutes 0
:VariantOfRecipeID 0
:VerifiedByClass ""
:VerifiedDateTime ""
:WebURL ""
:YieldNumber ""
:YieldUnit ""}})
require "http/client"
url = "{{baseUrl}}/recipe"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\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}}/recipe"),
Content = new StringContent("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\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}}/recipe");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe"
payload := strings.NewReader("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/recipe HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2261
{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/recipe")
.setHeader("content-type", "application/json")
.setBody("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\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 \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/recipe")
.header("content-type", "application/json")
.body("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}")
.asString();
const data = JSON.stringify({
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {
Department: '',
MasterIngredientID: 0,
Name: '',
UsuallyOnHand: false
},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/recipe');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe',
headers: {'content-type': 'application/json'},
data: {
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {Department: '', MasterIngredientID: 0, Name: '', UsuallyOnHand: false},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"AdTags":"","AdminBoost":0,"AllCategoriesText":"","BookmarkImageURL":"","BookmarkSiteLogo":"","BookmarkURL":"","Category":"","Collection":"","CollectionID":0,"CreationDate":"","Cuisine":"","Description":"","FavoriteCount":0,"HeroPhotoUrl":"","ImageSquares":[],"ImageURL":"","Ingredients":[{"DisplayIndex":0,"DisplayQuantity":"","HTMLName":"","IngredientID":0,"IngredientInfo":{"Department":"","MasterIngredientID":0,"Name":"","UsuallyOnHand":false},"IsHeading":false,"IsLinked":false,"MetricDisplayQuantity":"","MetricQuantity":"","MetricUnit":"","Name":"","PreparationNotes":"","Quantity":"","Unit":""}],"IngredientsTextBlock":"","Instructions":"","IsBookmark":false,"IsPrivate":false,"IsRecipeScan":false,"IsSponsored":false,"LastModified":"","MaxImageSquare":0,"MedalCount":0,"MenuCount":0,"Microcategory":"","NotesCount":0,"NutritionInfo":{"CaloriesFromFat":"","Cholesterol":"","CholesterolPct":"","DietaryFiber":"","DietaryFiberPct":"","MonoFat":"","PolyFat":"","Potassium":"","PotassiumPct":"","Protein":"","ProteinPct":"","SatFat":"","SatFatPct":"","SingularYieldUnit":"","Sodium":"","SodiumPct":"","Sugar":"","TotalCalories":"","TotalCarbs":"","TotalCarbsPct":"","TotalFat":"","TotalFatPct":"","TransFat":""},"Poster":{"FirstName":"","ImageUrl48":"","IsKitchenHelper":false,"IsPremium":false,"IsUsingRecurly":false,"LastName":"","MemberSince":"","PhotoUrl":"","PhotoUrl48":"","PremiumExpiryDate":"","UserID":0,"UserName":"","WebUrl":""},"PrimaryIngredient":"","RecipeID":0,"ReviewCount":0,"StarRating":"","Subcategory":"","Title":"","TotalMinutes":0,"VariantOfRecipeID":0,"VerifiedByClass":"","VerifiedDateTime":"","WebURL":"","YieldNumber":"","YieldUnit":""}'
};
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}}/recipe',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ActiveMinutes": 0,\n "AdTags": "",\n "AdminBoost": 0,\n "AllCategoriesText": "",\n "BookmarkImageURL": "",\n "BookmarkSiteLogo": "",\n "BookmarkURL": "",\n "Category": "",\n "Collection": "",\n "CollectionID": 0,\n "CreationDate": "",\n "Cuisine": "",\n "Description": "",\n "FavoriteCount": 0,\n "HeroPhotoUrl": "",\n "ImageSquares": [],\n "ImageURL": "",\n "Ingredients": [\n {\n "DisplayIndex": 0,\n "DisplayQuantity": "",\n "HTMLName": "",\n "IngredientID": 0,\n "IngredientInfo": {\n "Department": "",\n "MasterIngredientID": 0,\n "Name": "",\n "UsuallyOnHand": false\n },\n "IsHeading": false,\n "IsLinked": false,\n "MetricDisplayQuantity": "",\n "MetricQuantity": "",\n "MetricUnit": "",\n "Name": "",\n "PreparationNotes": "",\n "Quantity": "",\n "Unit": ""\n }\n ],\n "IngredientsTextBlock": "",\n "Instructions": "",\n "IsBookmark": false,\n "IsPrivate": false,\n "IsRecipeScan": false,\n "IsSponsored": false,\n "LastModified": "",\n "MaxImageSquare": 0,\n "MedalCount": 0,\n "MenuCount": 0,\n "Microcategory": "",\n "NotesCount": 0,\n "NutritionInfo": {\n "CaloriesFromFat": "",\n "Cholesterol": "",\n "CholesterolPct": "",\n "DietaryFiber": "",\n "DietaryFiberPct": "",\n "MonoFat": "",\n "PolyFat": "",\n "Potassium": "",\n "PotassiumPct": "",\n "Protein": "",\n "ProteinPct": "",\n "SatFat": "",\n "SatFatPct": "",\n "SingularYieldUnit": "",\n "Sodium": "",\n "SodiumPct": "",\n "Sugar": "",\n "TotalCalories": "",\n "TotalCarbs": "",\n "TotalCarbsPct": "",\n "TotalFat": "",\n "TotalFatPct": "",\n "TransFat": ""\n },\n "Poster": {\n "FirstName": "",\n "ImageUrl48": "",\n "IsKitchenHelper": false,\n "IsPremium": false,\n "IsUsingRecurly": false,\n "LastName": "",\n "MemberSince": "",\n "PhotoUrl": "",\n "PhotoUrl48": "",\n "PremiumExpiryDate": "",\n "UserID": 0,\n "UserName": "",\n "WebUrl": ""\n },\n "PrimaryIngredient": "",\n "RecipeID": 0,\n "ReviewCount": 0,\n "StarRating": "",\n "Subcategory": "",\n "Title": "",\n "TotalMinutes": 0,\n "VariantOfRecipeID": 0,\n "VerifiedByClass": "",\n "VerifiedDateTime": "",\n "WebURL": "",\n "YieldNumber": "",\n "YieldUnit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {Department: '', MasterIngredientID: 0, Name: '', UsuallyOnHand: false},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe',
headers: {'content-type': 'application/json'},
body: {
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {Department: '', MasterIngredientID: 0, Name: '', UsuallyOnHand: false},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
},
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}}/recipe');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {
Department: '',
MasterIngredientID: 0,
Name: '',
UsuallyOnHand: false
},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
});
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}}/recipe',
headers: {'content-type': 'application/json'},
data: {
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {Department: '', MasterIngredientID: 0, Name: '', UsuallyOnHand: false},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"AdTags":"","AdminBoost":0,"AllCategoriesText":"","BookmarkImageURL":"","BookmarkSiteLogo":"","BookmarkURL":"","Category":"","Collection":"","CollectionID":0,"CreationDate":"","Cuisine":"","Description":"","FavoriteCount":0,"HeroPhotoUrl":"","ImageSquares":[],"ImageURL":"","Ingredients":[{"DisplayIndex":0,"DisplayQuantity":"","HTMLName":"","IngredientID":0,"IngredientInfo":{"Department":"","MasterIngredientID":0,"Name":"","UsuallyOnHand":false},"IsHeading":false,"IsLinked":false,"MetricDisplayQuantity":"","MetricQuantity":"","MetricUnit":"","Name":"","PreparationNotes":"","Quantity":"","Unit":""}],"IngredientsTextBlock":"","Instructions":"","IsBookmark":false,"IsPrivate":false,"IsRecipeScan":false,"IsSponsored":false,"LastModified":"","MaxImageSquare":0,"MedalCount":0,"MenuCount":0,"Microcategory":"","NotesCount":0,"NutritionInfo":{"CaloriesFromFat":"","Cholesterol":"","CholesterolPct":"","DietaryFiber":"","DietaryFiberPct":"","MonoFat":"","PolyFat":"","Potassium":"","PotassiumPct":"","Protein":"","ProteinPct":"","SatFat":"","SatFatPct":"","SingularYieldUnit":"","Sodium":"","SodiumPct":"","Sugar":"","TotalCalories":"","TotalCarbs":"","TotalCarbsPct":"","TotalFat":"","TotalFatPct":"","TransFat":""},"Poster":{"FirstName":"","ImageUrl48":"","IsKitchenHelper":false,"IsPremium":false,"IsUsingRecurly":false,"LastName":"","MemberSince":"","PhotoUrl":"","PhotoUrl48":"","PremiumExpiryDate":"","UserID":0,"UserName":"","WebUrl":""},"PrimaryIngredient":"","RecipeID":0,"ReviewCount":0,"StarRating":"","Subcategory":"","Title":"","TotalMinutes":0,"VariantOfRecipeID":0,"VerifiedByClass":"","VerifiedDateTime":"","WebURL":"","YieldNumber":"","YieldUnit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ActiveMinutes": @0,
@"AdTags": @"",
@"AdminBoost": @0,
@"AllCategoriesText": @"",
@"BookmarkImageURL": @"",
@"BookmarkSiteLogo": @"",
@"BookmarkURL": @"",
@"Category": @"",
@"Collection": @"",
@"CollectionID": @0,
@"CreationDate": @"",
@"Cuisine": @"",
@"Description": @"",
@"FavoriteCount": @0,
@"HeroPhotoUrl": @"",
@"ImageSquares": @[ ],
@"ImageURL": @"",
@"Ingredients": @[ @{ @"DisplayIndex": @0, @"DisplayQuantity": @"", @"HTMLName": @"", @"IngredientID": @0, @"IngredientInfo": @{ @"Department": @"", @"MasterIngredientID": @0, @"Name": @"", @"UsuallyOnHand": @NO }, @"IsHeading": @NO, @"IsLinked": @NO, @"MetricDisplayQuantity": @"", @"MetricQuantity": @"", @"MetricUnit": @"", @"Name": @"", @"PreparationNotes": @"", @"Quantity": @"", @"Unit": @"" } ],
@"IngredientsTextBlock": @"",
@"Instructions": @"",
@"IsBookmark": @NO,
@"IsPrivate": @NO,
@"IsRecipeScan": @NO,
@"IsSponsored": @NO,
@"LastModified": @"",
@"MaxImageSquare": @0,
@"MedalCount": @0,
@"MenuCount": @0,
@"Microcategory": @"",
@"NotesCount": @0,
@"NutritionInfo": @{ @"CaloriesFromFat": @"", @"Cholesterol": @"", @"CholesterolPct": @"", @"DietaryFiber": @"", @"DietaryFiberPct": @"", @"MonoFat": @"", @"PolyFat": @"", @"Potassium": @"", @"PotassiumPct": @"", @"Protein": @"", @"ProteinPct": @"", @"SatFat": @"", @"SatFatPct": @"", @"SingularYieldUnit": @"", @"Sodium": @"", @"SodiumPct": @"", @"Sugar": @"", @"TotalCalories": @"", @"TotalCarbs": @"", @"TotalCarbsPct": @"", @"TotalFat": @"", @"TotalFatPct": @"", @"TransFat": @"" },
@"Poster": @{ @"FirstName": @"", @"ImageUrl48": @"", @"IsKitchenHelper": @NO, @"IsPremium": @NO, @"IsUsingRecurly": @NO, @"LastName": @"", @"MemberSince": @"", @"PhotoUrl": @"", @"PhotoUrl48": @"", @"PremiumExpiryDate": @"", @"UserID": @0, @"UserName": @"", @"WebUrl": @"" },
@"PrimaryIngredient": @"",
@"RecipeID": @0,
@"ReviewCount": @0,
@"StarRating": @"",
@"Subcategory": @"",
@"Title": @"",
@"TotalMinutes": @0,
@"VariantOfRecipeID": @0,
@"VerifiedByClass": @"",
@"VerifiedDateTime": @"",
@"WebURL": @"",
@"YieldNumber": @"",
@"YieldUnit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe"]
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}}/recipe" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe",
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([
'ActiveMinutes' => 0,
'AdTags' => '',
'AdminBoost' => 0,
'AllCategoriesText' => '',
'BookmarkImageURL' => '',
'BookmarkSiteLogo' => '',
'BookmarkURL' => '',
'Category' => '',
'Collection' => '',
'CollectionID' => 0,
'CreationDate' => '',
'Cuisine' => '',
'Description' => '',
'FavoriteCount' => 0,
'HeroPhotoUrl' => '',
'ImageSquares' => [
],
'ImageURL' => '',
'Ingredients' => [
[
'DisplayIndex' => 0,
'DisplayQuantity' => '',
'HTMLName' => '',
'IngredientID' => 0,
'IngredientInfo' => [
'Department' => '',
'MasterIngredientID' => 0,
'Name' => '',
'UsuallyOnHand' => null
],
'IsHeading' => null,
'IsLinked' => null,
'MetricDisplayQuantity' => '',
'MetricQuantity' => '',
'MetricUnit' => '',
'Name' => '',
'PreparationNotes' => '',
'Quantity' => '',
'Unit' => ''
]
],
'IngredientsTextBlock' => '',
'Instructions' => '',
'IsBookmark' => null,
'IsPrivate' => null,
'IsRecipeScan' => null,
'IsSponsored' => null,
'LastModified' => '',
'MaxImageSquare' => 0,
'MedalCount' => 0,
'MenuCount' => 0,
'Microcategory' => '',
'NotesCount' => 0,
'NutritionInfo' => [
'CaloriesFromFat' => '',
'Cholesterol' => '',
'CholesterolPct' => '',
'DietaryFiber' => '',
'DietaryFiberPct' => '',
'MonoFat' => '',
'PolyFat' => '',
'Potassium' => '',
'PotassiumPct' => '',
'Protein' => '',
'ProteinPct' => '',
'SatFat' => '',
'SatFatPct' => '',
'SingularYieldUnit' => '',
'Sodium' => '',
'SodiumPct' => '',
'Sugar' => '',
'TotalCalories' => '',
'TotalCarbs' => '',
'TotalCarbsPct' => '',
'TotalFat' => '',
'TotalFatPct' => '',
'TransFat' => ''
],
'Poster' => [
'FirstName' => '',
'ImageUrl48' => '',
'IsKitchenHelper' => null,
'IsPremium' => null,
'IsUsingRecurly' => null,
'LastName' => '',
'MemberSince' => '',
'PhotoUrl' => '',
'PhotoUrl48' => '',
'PremiumExpiryDate' => '',
'UserID' => 0,
'UserName' => '',
'WebUrl' => ''
],
'PrimaryIngredient' => '',
'RecipeID' => 0,
'ReviewCount' => 0,
'StarRating' => '',
'Subcategory' => '',
'Title' => '',
'TotalMinutes' => 0,
'VariantOfRecipeID' => 0,
'VerifiedByClass' => '',
'VerifiedDateTime' => '',
'WebURL' => '',
'YieldNumber' => '',
'YieldUnit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/recipe', [
'body' => '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ActiveMinutes' => 0,
'AdTags' => '',
'AdminBoost' => 0,
'AllCategoriesText' => '',
'BookmarkImageURL' => '',
'BookmarkSiteLogo' => '',
'BookmarkURL' => '',
'Category' => '',
'Collection' => '',
'CollectionID' => 0,
'CreationDate' => '',
'Cuisine' => '',
'Description' => '',
'FavoriteCount' => 0,
'HeroPhotoUrl' => '',
'ImageSquares' => [
],
'ImageURL' => '',
'Ingredients' => [
[
'DisplayIndex' => 0,
'DisplayQuantity' => '',
'HTMLName' => '',
'IngredientID' => 0,
'IngredientInfo' => [
'Department' => '',
'MasterIngredientID' => 0,
'Name' => '',
'UsuallyOnHand' => null
],
'IsHeading' => null,
'IsLinked' => null,
'MetricDisplayQuantity' => '',
'MetricQuantity' => '',
'MetricUnit' => '',
'Name' => '',
'PreparationNotes' => '',
'Quantity' => '',
'Unit' => ''
]
],
'IngredientsTextBlock' => '',
'Instructions' => '',
'IsBookmark' => null,
'IsPrivate' => null,
'IsRecipeScan' => null,
'IsSponsored' => null,
'LastModified' => '',
'MaxImageSquare' => 0,
'MedalCount' => 0,
'MenuCount' => 0,
'Microcategory' => '',
'NotesCount' => 0,
'NutritionInfo' => [
'CaloriesFromFat' => '',
'Cholesterol' => '',
'CholesterolPct' => '',
'DietaryFiber' => '',
'DietaryFiberPct' => '',
'MonoFat' => '',
'PolyFat' => '',
'Potassium' => '',
'PotassiumPct' => '',
'Protein' => '',
'ProteinPct' => '',
'SatFat' => '',
'SatFatPct' => '',
'SingularYieldUnit' => '',
'Sodium' => '',
'SodiumPct' => '',
'Sugar' => '',
'TotalCalories' => '',
'TotalCarbs' => '',
'TotalCarbsPct' => '',
'TotalFat' => '',
'TotalFatPct' => '',
'TransFat' => ''
],
'Poster' => [
'FirstName' => '',
'ImageUrl48' => '',
'IsKitchenHelper' => null,
'IsPremium' => null,
'IsUsingRecurly' => null,
'LastName' => '',
'MemberSince' => '',
'PhotoUrl' => '',
'PhotoUrl48' => '',
'PremiumExpiryDate' => '',
'UserID' => 0,
'UserName' => '',
'WebUrl' => ''
],
'PrimaryIngredient' => '',
'RecipeID' => 0,
'ReviewCount' => 0,
'StarRating' => '',
'Subcategory' => '',
'Title' => '',
'TotalMinutes' => 0,
'VariantOfRecipeID' => 0,
'VerifiedByClass' => '',
'VerifiedDateTime' => '',
'WebURL' => '',
'YieldNumber' => '',
'YieldUnit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ActiveMinutes' => 0,
'AdTags' => '',
'AdminBoost' => 0,
'AllCategoriesText' => '',
'BookmarkImageURL' => '',
'BookmarkSiteLogo' => '',
'BookmarkURL' => '',
'Category' => '',
'Collection' => '',
'CollectionID' => 0,
'CreationDate' => '',
'Cuisine' => '',
'Description' => '',
'FavoriteCount' => 0,
'HeroPhotoUrl' => '',
'ImageSquares' => [
],
'ImageURL' => '',
'Ingredients' => [
[
'DisplayIndex' => 0,
'DisplayQuantity' => '',
'HTMLName' => '',
'IngredientID' => 0,
'IngredientInfo' => [
'Department' => '',
'MasterIngredientID' => 0,
'Name' => '',
'UsuallyOnHand' => null
],
'IsHeading' => null,
'IsLinked' => null,
'MetricDisplayQuantity' => '',
'MetricQuantity' => '',
'MetricUnit' => '',
'Name' => '',
'PreparationNotes' => '',
'Quantity' => '',
'Unit' => ''
]
],
'IngredientsTextBlock' => '',
'Instructions' => '',
'IsBookmark' => null,
'IsPrivate' => null,
'IsRecipeScan' => null,
'IsSponsored' => null,
'LastModified' => '',
'MaxImageSquare' => 0,
'MedalCount' => 0,
'MenuCount' => 0,
'Microcategory' => '',
'NotesCount' => 0,
'NutritionInfo' => [
'CaloriesFromFat' => '',
'Cholesterol' => '',
'CholesterolPct' => '',
'DietaryFiber' => '',
'DietaryFiberPct' => '',
'MonoFat' => '',
'PolyFat' => '',
'Potassium' => '',
'PotassiumPct' => '',
'Protein' => '',
'ProteinPct' => '',
'SatFat' => '',
'SatFatPct' => '',
'SingularYieldUnit' => '',
'Sodium' => '',
'SodiumPct' => '',
'Sugar' => '',
'TotalCalories' => '',
'TotalCarbs' => '',
'TotalCarbsPct' => '',
'TotalFat' => '',
'TotalFatPct' => '',
'TransFat' => ''
],
'Poster' => [
'FirstName' => '',
'ImageUrl48' => '',
'IsKitchenHelper' => null,
'IsPremium' => null,
'IsUsingRecurly' => null,
'LastName' => '',
'MemberSince' => '',
'PhotoUrl' => '',
'PhotoUrl48' => '',
'PremiumExpiryDate' => '',
'UserID' => 0,
'UserName' => '',
'WebUrl' => ''
],
'PrimaryIngredient' => '',
'RecipeID' => 0,
'ReviewCount' => 0,
'StarRating' => '',
'Subcategory' => '',
'Title' => '',
'TotalMinutes' => 0,
'VariantOfRecipeID' => 0,
'VerifiedByClass' => '',
'VerifiedDateTime' => '',
'WebURL' => '',
'YieldNumber' => '',
'YieldUnit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/recipe');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/recipe", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe"
payload = {
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": False
},
"IsHeading": False,
"IsLinked": False,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": False,
"IsPrivate": False,
"IsRecipeScan": False,
"IsSponsored": False,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": False,
"IsPremium": False,
"IsUsingRecurly": False,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe"
payload <- "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\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}}/recipe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/recipe') do |req|
req.body = "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe";
let payload = json!({
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": (),
"ImageURL": "",
"Ingredients": (
json!({
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": json!({
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
}),
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
})
),
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": json!({
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
}),
"Poster": json!({
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
}),
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/recipe \
--header 'content-type: application/json' \
--data '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}'
echo '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}' | \
http POST {{baseUrl}}/recipe \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ActiveMinutes": 0,\n "AdTags": "",\n "AdminBoost": 0,\n "AllCategoriesText": "",\n "BookmarkImageURL": "",\n "BookmarkSiteLogo": "",\n "BookmarkURL": "",\n "Category": "",\n "Collection": "",\n "CollectionID": 0,\n "CreationDate": "",\n "Cuisine": "",\n "Description": "",\n "FavoriteCount": 0,\n "HeroPhotoUrl": "",\n "ImageSquares": [],\n "ImageURL": "",\n "Ingredients": [\n {\n "DisplayIndex": 0,\n "DisplayQuantity": "",\n "HTMLName": "",\n "IngredientID": 0,\n "IngredientInfo": {\n "Department": "",\n "MasterIngredientID": 0,\n "Name": "",\n "UsuallyOnHand": false\n },\n "IsHeading": false,\n "IsLinked": false,\n "MetricDisplayQuantity": "",\n "MetricQuantity": "",\n "MetricUnit": "",\n "Name": "",\n "PreparationNotes": "",\n "Quantity": "",\n "Unit": ""\n }\n ],\n "IngredientsTextBlock": "",\n "Instructions": "",\n "IsBookmark": false,\n "IsPrivate": false,\n "IsRecipeScan": false,\n "IsSponsored": false,\n "LastModified": "",\n "MaxImageSquare": 0,\n "MedalCount": 0,\n "MenuCount": 0,\n "Microcategory": "",\n "NotesCount": 0,\n "NutritionInfo": {\n "CaloriesFromFat": "",\n "Cholesterol": "",\n "CholesterolPct": "",\n "DietaryFiber": "",\n "DietaryFiberPct": "",\n "MonoFat": "",\n "PolyFat": "",\n "Potassium": "",\n "PotassiumPct": "",\n "Protein": "",\n "ProteinPct": "",\n "SatFat": "",\n "SatFatPct": "",\n "SingularYieldUnit": "",\n "Sodium": "",\n "SodiumPct": "",\n "Sugar": "",\n "TotalCalories": "",\n "TotalCarbs": "",\n "TotalCarbsPct": "",\n "TotalFat": "",\n "TotalFatPct": "",\n "TransFat": ""\n },\n "Poster": {\n "FirstName": "",\n "ImageUrl48": "",\n "IsKitchenHelper": false,\n "IsPremium": false,\n "IsUsingRecurly": false,\n "LastName": "",\n "MemberSince": "",\n "PhotoUrl": "",\n "PhotoUrl48": "",\n "PremiumExpiryDate": "",\n "UserID": 0,\n "UserName": "",\n "WebUrl": ""\n },\n "PrimaryIngredient": "",\n "RecipeID": 0,\n "ReviewCount": 0,\n "StarRating": "",\n "Subcategory": "",\n "Title": "",\n "TotalMinutes": 0,\n "VariantOfRecipeID": 0,\n "VerifiedByClass": "",\n "VerifiedDateTime": "",\n "WebURL": "",\n "YieldNumber": "",\n "YieldUnit": ""\n}' \
--output-document \
- {{baseUrl}}/recipe
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
[
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": [
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
],
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
]
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": [
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
],
"Poster": [
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
],
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Automatics the complete all recipes.
{{baseUrl}}/recipe/autocomplete/all
QUERY PARAMS
query
limit
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/autocomplete/all?query=&limit=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/autocomplete/all" {:query-params {:query ""
:limit ""}})
require "http/client"
url = "{{baseUrl}}/recipe/autocomplete/all?query=&limit="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/autocomplete/all?query=&limit="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/autocomplete/all?query=&limit=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/autocomplete/all?query=&limit="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/autocomplete/all?query=&limit= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/autocomplete/all?query=&limit=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/autocomplete/all?query=&limit="))
.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}}/recipe/autocomplete/all?query=&limit=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/autocomplete/all?query=&limit=")
.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}}/recipe/autocomplete/all?query=&limit=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/autocomplete/all',
params: {query: '', limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/autocomplete/all?query=&limit=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/autocomplete/all?query=&limit=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/autocomplete/all?query=&limit=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/autocomplete/all?query=&limit=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/autocomplete/all',
qs: {query: '', limit: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/autocomplete/all');
req.query({
query: '',
limit: ''
});
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}}/recipe/autocomplete/all',
params: {query: '', limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/autocomplete/all?query=&limit=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/autocomplete/all?query=&limit="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/autocomplete/all?query=&limit=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/autocomplete/all?query=&limit=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/autocomplete/all?query=&limit=');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/autocomplete/all');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'query' => '',
'limit' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/autocomplete/all');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'query' => '',
'limit' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/autocomplete/all?query=&limit=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/autocomplete/all?query=&limit=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/autocomplete/all?query=&limit=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/autocomplete/all"
querystring = {"query":"","limit":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/autocomplete/all"
queryString <- list(
query = "",
limit = ""
)
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/autocomplete/all?query=&limit=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/autocomplete/all') do |req|
req.params['query'] = ''
req.params['limit'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/autocomplete/all";
let querystring = [
("query", ""),
("limit", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/recipe/autocomplete/all?query=&limit='
http GET '{{baseUrl}}/recipe/autocomplete/all?query=&limit='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/recipe/autocomplete/all?query=&limit='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/autocomplete/all?query=&limit=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Automatics the complete my recipes.
{{baseUrl}}/recipe/autocomplete/mine
QUERY PARAMS
query
limit
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/autocomplete/mine?query=&limit=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/autocomplete/mine" {:query-params {:query ""
:limit ""}})
require "http/client"
url = "{{baseUrl}}/recipe/autocomplete/mine?query=&limit="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/autocomplete/mine?query=&limit="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/autocomplete/mine?query=&limit=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/autocomplete/mine?query=&limit="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/autocomplete/mine?query=&limit= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/autocomplete/mine?query=&limit=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/autocomplete/mine?query=&limit="))
.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}}/recipe/autocomplete/mine?query=&limit=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/autocomplete/mine?query=&limit=")
.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}}/recipe/autocomplete/mine?query=&limit=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/autocomplete/mine',
params: {query: '', limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/autocomplete/mine?query=&limit=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/autocomplete/mine?query=&limit=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/autocomplete/mine?query=&limit=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/autocomplete/mine?query=&limit=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/autocomplete/mine',
qs: {query: '', limit: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/autocomplete/mine');
req.query({
query: '',
limit: ''
});
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}}/recipe/autocomplete/mine',
params: {query: '', limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/autocomplete/mine?query=&limit=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/autocomplete/mine?query=&limit="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/autocomplete/mine?query=&limit=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/autocomplete/mine?query=&limit=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/autocomplete/mine?query=&limit=');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/autocomplete/mine');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'query' => '',
'limit' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/autocomplete/mine');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'query' => '',
'limit' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/autocomplete/mine?query=&limit=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/autocomplete/mine?query=&limit=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/autocomplete/mine?query=&limit=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/autocomplete/mine"
querystring = {"query":"","limit":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/autocomplete/mine"
queryString <- list(
query = "",
limit = ""
)
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/autocomplete/mine?query=&limit=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/autocomplete/mine') do |req|
req.params['query'] = ''
req.params['limit'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/autocomplete/mine";
let querystring = [
("query", ""),
("limit", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/recipe/autocomplete/mine?query=&limit='
http GET '{{baseUrl}}/recipe/autocomplete/mine?query=&limit='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/recipe/autocomplete/mine?query=&limit='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/autocomplete/mine?query=&limit=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete a Recipe (you must be authenticated as an owner of the recipe)
{{baseUrl}}/recipe/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/recipe/:id")
require "http/client"
url = "{{baseUrl}}/recipe/:id"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/recipe/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:id");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:id"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/recipe/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/recipe/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:id"))
.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}}/recipe/:id")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/recipe/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/recipe/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/recipe/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:id';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:id',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:id")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'DELETE', url: '{{baseUrl}}/recipe/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/recipe/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'DELETE', url: '{{baseUrl}}/recipe/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:id';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:id" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/recipe/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:id');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:id');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:id' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:id' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/recipe/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:id"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:id"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/recipe/:id') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:id";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/recipe/:id
http DELETE {{baseUrl}}/recipe/:id
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/recipe/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Feedback on a Recipe -- for internal BigOven editors
{{baseUrl}}/recipe/:recipeId/feedback
QUERY PARAMS
recipeId
BODY json
{
"feedback": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/feedback");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"feedback\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/recipe/:recipeId/feedback" {:content-type :json
:form-params {:feedback ""}})
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/feedback"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"feedback\": \"\"\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}}/recipe/:recipeId/feedback"),
Content = new StringContent("{\n \"feedback\": \"\"\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}}/recipe/:recipeId/feedback");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"feedback\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/feedback"
payload := strings.NewReader("{\n \"feedback\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/recipe/:recipeId/feedback HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"feedback": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/recipe/:recipeId/feedback")
.setHeader("content-type", "application/json")
.setBody("{\n \"feedback\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/feedback"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"feedback\": \"\"\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 \"feedback\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/feedback")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/recipe/:recipeId/feedback")
.header("content-type", "application/json")
.body("{\n \"feedback\": \"\"\n}")
.asString();
const data = JSON.stringify({
feedback: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/recipe/:recipeId/feedback');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/:recipeId/feedback',
headers: {'content-type': 'application/json'},
data: {feedback: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/feedback';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"feedback":""}'
};
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}}/recipe/:recipeId/feedback',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "feedback": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"feedback\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/feedback")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/feedback',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({feedback: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/:recipeId/feedback',
headers: {'content-type': 'application/json'},
body: {feedback: ''},
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}}/recipe/:recipeId/feedback');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
feedback: ''
});
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}}/recipe/:recipeId/feedback',
headers: {'content-type': 'application/json'},
data: {feedback: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/feedback';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"feedback":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"feedback": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/feedback"]
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}}/recipe/:recipeId/feedback" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"feedback\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/feedback",
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([
'feedback' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/recipe/:recipeId/feedback', [
'body' => '{
"feedback": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/feedback');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'feedback' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'feedback' => ''
]));
$request->setRequestUrl('{{baseUrl}}/recipe/:recipeId/feedback');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/feedback' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"feedback": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/feedback' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"feedback": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"feedback\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/recipe/:recipeId/feedback", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/feedback"
payload = { "feedback": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/feedback"
payload <- "{\n \"feedback\": \"\"\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}}/recipe/:recipeId/feedback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"feedback\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/recipe/:recipeId/feedback') do |req|
req.body = "{\n \"feedback\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/feedback";
let payload = json!({"feedback": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/recipe/:recipeId/feedback \
--header 'content-type: application/json' \
--data '{
"feedback": ""
}'
echo '{
"feedback": ""
}' | \
http POST {{baseUrl}}/recipe/:recipeId/feedback \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "feedback": ""\n}' \
--output-document \
- {{baseUrl}}/recipe/:recipeId/feedback
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["feedback": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/feedback")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get a list of recipe categories (the ID field can be used for include_cat in search parameters)
{{baseUrl}}/recipe/categories
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/categories");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/categories")
require "http/client"
url = "{{baseUrl}}/recipe/categories"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/categories"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/categories");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/categories"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/categories HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/categories")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/categories"))
.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}}/recipe/categories")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/categories")
.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}}/recipe/categories');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/categories'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/categories';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/categories',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/categories")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/categories',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/categories'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/categories');
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}}/recipe/categories'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/categories';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/categories"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/categories" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/categories');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/categories');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/categories');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/categories' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/categories' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/categories")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/categories"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/categories"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/categories') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/categories";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/categories
http GET {{baseUrl}}/recipe/categories
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/categories
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/categories")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get a list of recipes that the authenticated user has most recently viewed
{{baseUrl}}/recipes/recentviews
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipes/recentviews");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipes/recentviews")
require "http/client"
url = "{{baseUrl}}/recipes/recentviews"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipes/recentviews"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipes/recentviews");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipes/recentviews"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipes/recentviews HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipes/recentviews")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipes/recentviews"))
.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}}/recipes/recentviews")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipes/recentviews")
.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}}/recipes/recentviews');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipes/recentviews'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipes/recentviews';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipes/recentviews',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipes/recentviews")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipes/recentviews',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipes/recentviews'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipes/recentviews');
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}}/recipes/recentviews'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipes/recentviews';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipes/recentviews"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipes/recentviews" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipes/recentviews",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipes/recentviews');
echo $response->getBody();
setUrl('{{baseUrl}}/recipes/recentviews');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipes/recentviews');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipes/recentviews' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipes/recentviews' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipes/recentviews")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipes/recentviews"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipes/recentviews"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipes/recentviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipes/recentviews') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipes/recentviews";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipes/recentviews
http GET {{baseUrl}}/recipes/recentviews
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipes/recentviews
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipes/recentviews")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get a random, home-page-quality Recipe.
{{baseUrl}}/recipes/random
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipes/random");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipes/random")
require "http/client"
url = "{{baseUrl}}/recipes/random"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipes/random"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipes/random");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipes/random"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipes/random HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipes/random")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipes/random"))
.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}}/recipes/random")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipes/random")
.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}}/recipes/random');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipes/random'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipes/random';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipes/random',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipes/random")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipes/random',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipes/random'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipes/random');
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}}/recipes/random'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipes/random';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipes/random"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipes/random" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipes/random",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipes/random');
echo $response->getBody();
setUrl('{{baseUrl}}/recipes/random');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipes/random');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipes/random' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipes/random' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipes/random")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipes/random"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipes/random"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipes/random")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipes/random') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipes/random";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipes/random
http GET {{baseUrl}}/recipes/random
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipes/random
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipes/random")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/related");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:recipeId/related")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/related"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/related"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/related");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/related"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:recipeId/related HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:recipeId/related")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/related"))
.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}}/recipe/:recipeId/related")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:recipeId/related")
.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}}/recipe/:recipeId/related');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/related'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/related';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/related',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/related")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/related',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/related'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:recipeId/related');
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}}/recipe/:recipeId/related'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/related';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/related"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/related" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/related",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:recipeId/related');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/related');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/related');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/related' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/related' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:recipeId/related")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/related"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/related"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/related")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:recipeId/related') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/related";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:recipeId/related
http GET {{baseUrl}}/recipe/:recipeId/related
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:recipeId/related
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/related")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get the recipe-comment tuples for those recipes with 4 or 5 star ratings
{{baseUrl}}/recipes/raves
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipes/raves");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipes/raves")
require "http/client"
url = "{{baseUrl}}/recipes/raves"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipes/raves"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipes/raves");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipes/raves"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipes/raves HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipes/raves")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipes/raves"))
.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}}/recipes/raves")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipes/raves")
.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}}/recipes/raves');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipes/raves'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipes/raves';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipes/raves',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipes/raves")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipes/raves',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipes/raves'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipes/raves');
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}}/recipes/raves'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipes/raves';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipes/raves"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipes/raves" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipes/raves",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipes/raves');
echo $response->getBody();
setUrl('{{baseUrl}}/recipes/raves');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipes/raves');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipes/raves' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipes/raves' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipes/raves")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipes/raves"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipes/raves"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipes/raves")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipes/raves') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipes/raves";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipes/raves
http GET {{baseUrl}}/recipes/raves
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipes/raves
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipes/raves")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Gets recipe single step as text
{{baseUrl}}/recipe/get/saved/step
QUERY PARAMS
userName
recipeId
stepId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/recipe/get/saved/step" {:query-params {:userName ""
:recipeId ""
:stepId ""}})
require "http/client"
url = "{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/recipe/get/saved/step?userName=&recipeId=&stepId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/get/saved/step',
params: {userName: '', recipeId: '', stepId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/get/saved/step?userName=&recipeId=&stepId=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/get/saved/step',
qs: {userName: '', recipeId: '', stepId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/recipe/get/saved/step');
req.query({
userName: '',
recipeId: '',
stepId: ''
});
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}}/recipe/get/saved/step',
params: {userName: '', recipeId: '', stepId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/get/saved/step');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'userName' => '',
'recipeId' => '',
'stepId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/get/saved/step');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'userName' => '',
'recipeId' => '',
'stepId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/recipe/get/saved/step?userName=&recipeId=&stepId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/get/saved/step"
querystring = {"userName":"","recipeId":"","stepId":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/get/saved/step"
queryString <- list(
userName = "",
recipeId = "",
stepId = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/recipe/get/saved/step') do |req|
req.params['userName'] = ''
req.params['recipeId'] = ''
req.params['stepId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/get/saved/step";
let querystring = [
("userName", ""),
("recipeId", ""),
("stepId", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId='
http POST '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/get/saved/step?userName=&recipeId=&stepId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Given a query, return recipe titles starting with query. Query must be at least 3 chars in length.
{{baseUrl}}/recipe/autocomplete
QUERY PARAMS
query
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/autocomplete?query=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/autocomplete" {:query-params {:query ""}})
require "http/client"
url = "{{baseUrl}}/recipe/autocomplete?query="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/autocomplete?query="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/autocomplete?query=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/autocomplete?query="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/autocomplete?query= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/autocomplete?query=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/autocomplete?query="))
.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}}/recipe/autocomplete?query=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/autocomplete?query=")
.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}}/recipe/autocomplete?query=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/autocomplete',
params: {query: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/autocomplete?query=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/autocomplete?query=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/autocomplete?query=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/autocomplete?query=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/autocomplete',
qs: {query: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/autocomplete');
req.query({
query: ''
});
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}}/recipe/autocomplete',
params: {query: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/autocomplete?query=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/autocomplete?query="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/autocomplete?query=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/autocomplete?query=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/autocomplete?query=');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/autocomplete');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'query' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/autocomplete');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'query' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/autocomplete?query=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/autocomplete?query=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/autocomplete?query=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/autocomplete"
querystring = {"query":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/autocomplete"
queryString <- list(query = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/autocomplete?query=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/autocomplete') do |req|
req.params['query'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/autocomplete";
let querystring = [
("query", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/recipe/autocomplete?query='
http GET '{{baseUrl}}/recipe/autocomplete?query='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/recipe/autocomplete?query='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/autocomplete?query=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Return full Recipe detail with steps. Returns 403 if the recipe is owned by someone else.
{{baseUrl}}/recipe/steps/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/steps/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/steps/:id")
require "http/client"
url = "{{baseUrl}}/recipe/steps/:id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/steps/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/steps/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/steps/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/steps/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/steps/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/steps/:id"))
.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}}/recipe/steps/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/steps/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/recipe/steps/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/steps/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/steps/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/steps/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/steps/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/steps/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/steps/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/steps/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/recipe/steps/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/steps/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/steps/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/steps/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/steps/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/steps/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/steps/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/steps/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/steps/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/steps/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/steps/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/steps/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/steps/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/steps/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/steps/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/steps/:id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/steps/:id
http GET {{baseUrl}}/recipe/steps/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/steps/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/steps/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Return full Recipe detail. Returns 403 if the recipe is owned by someone else.
{{baseUrl}}/recipe/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:id")
require "http/client"
url = "{{baseUrl}}/recipe/:id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:id"))
.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}}/recipe/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/recipe/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:id
http GET {{baseUrl}}/recipe/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Returns last active recipe for the user
{{baseUrl}}/recipe/get/active/recipe
QUERY PARAMS
userName
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/get/active/recipe?userName=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/get/active/recipe" {:query-params {:userName ""}})
require "http/client"
url = "{{baseUrl}}/recipe/get/active/recipe?userName="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/get/active/recipe?userName="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/get/active/recipe?userName=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/get/active/recipe?userName="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/get/active/recipe?userName= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/get/active/recipe?userName=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/get/active/recipe?userName="))
.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}}/recipe/get/active/recipe?userName=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/get/active/recipe?userName=")
.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}}/recipe/get/active/recipe?userName=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/get/active/recipe',
params: {userName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/get/active/recipe?userName=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/get/active/recipe?userName=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/get/active/recipe?userName=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/get/active/recipe?userName=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/get/active/recipe',
qs: {userName: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/get/active/recipe');
req.query({
userName: ''
});
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}}/recipe/get/active/recipe',
params: {userName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/get/active/recipe?userName=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/get/active/recipe?userName="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/get/active/recipe?userName=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/get/active/recipe?userName=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/get/active/recipe?userName=');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/get/active/recipe');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'userName' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/get/active/recipe');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'userName' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/get/active/recipe?userName=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/get/active/recipe?userName=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/get/active/recipe?userName=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/get/active/recipe"
querystring = {"userName":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/get/active/recipe"
queryString <- list(userName = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/get/active/recipe?userName=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/get/active/recipe') do |req|
req.params['userName'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/get/active/recipe";
let querystring = [
("userName", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/recipe/get/active/recipe?userName='
http GET '{{baseUrl}}/recipe/get/active/recipe?userName='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/recipe/get/active/recipe?userName='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/get/active/recipe?userName=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Returns stored step number and number of steps in recipe
{{baseUrl}}/recipe/get/step/number
QUERY PARAMS
userName
recipeId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/get/step/number?userName=&recipeId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/recipe/get/step/number" {:query-params {:userName ""
:recipeId ""}})
require "http/client"
url = "{{baseUrl}}/recipe/get/step/number?userName=&recipeId="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/recipe/get/step/number?userName=&recipeId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/get/step/number?userName=&recipeId=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/get/step/number?userName=&recipeId="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/recipe/get/step/number?userName=&recipeId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/recipe/get/step/number?userName=&recipeId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/get/step/number?userName=&recipeId="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/get/step/number?userName=&recipeId=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/recipe/get/step/number?userName=&recipeId=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/recipe/get/step/number?userName=&recipeId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/get/step/number',
params: {userName: '', recipeId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/get/step/number?userName=&recipeId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/get/step/number?userName=&recipeId=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/get/step/number?userName=&recipeId=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/get/step/number?userName=&recipeId=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/get/step/number',
qs: {userName: '', recipeId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/recipe/get/step/number');
req.query({
userName: '',
recipeId: ''
});
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}}/recipe/get/step/number',
params: {userName: '', recipeId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/get/step/number?userName=&recipeId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/get/step/number?userName=&recipeId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/get/step/number?userName=&recipeId=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/get/step/number?userName=&recipeId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/recipe/get/step/number?userName=&recipeId=');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/get/step/number');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'userName' => '',
'recipeId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/get/step/number');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'userName' => '',
'recipeId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/get/step/number?userName=&recipeId=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/get/step/number?userName=&recipeId=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/recipe/get/step/number?userName=&recipeId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/get/step/number"
querystring = {"userName":"","recipeId":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/get/step/number"
queryString <- list(
userName = "",
recipeId = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/get/step/number?userName=&recipeId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/recipe/get/step/number') do |req|
req.params['userName'] = ''
req.params['recipeId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/get/step/number";
let querystring = [
("userName", ""),
("recipeId", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/recipe/get/step/number?userName=&recipeId='
http POST '{{baseUrl}}/recipe/get/step/number?userName=&recipeId='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/recipe/get/step/number?userName=&recipeId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/get/step/number?userName=&recipeId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Same as GET recipe but also includes the recipe videos (if any)
{{baseUrl}}/recipes/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipes/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipes/:id")
require "http/client"
url = "{{baseUrl}}/recipes/:id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipes/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipes/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipes/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipes/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipes/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipes/:id"))
.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}}/recipes/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipes/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/recipes/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipes/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipes/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipes/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipes/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipes/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipes/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipes/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/recipes/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipes/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipes/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipes/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipes/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipes/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/recipes/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipes/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipes/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipes/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipes/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipes/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipes/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipes/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipes/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipes/:id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipes/:id
http GET {{baseUrl}}/recipes/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipes/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipes/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Stores recipe step number and returns saved step data
{{baseUrl}}/recipe/post/step
QUERY PARAMS
userName
recipeId
stepId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/recipe/post/step" {:query-params {:userName ""
:recipeId ""
:stepId ""}})
require "http/client"
url = "{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/recipe/post/step?userName=&recipeId=&stepId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/post/step',
params: {userName: '', recipeId: '', stepId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/post/step?userName=&recipeId=&stepId=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/post/step',
qs: {userName: '', recipeId: '', stepId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/recipe/post/step');
req.query({
userName: '',
recipeId: '',
stepId: ''
});
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}}/recipe/post/step',
params: {userName: '', recipeId: '', stepId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/post/step');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'userName' => '',
'recipeId' => '',
'stepId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/post/step');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'userName' => '',
'recipeId' => '',
'stepId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/recipe/post/step?userName=&recipeId=&stepId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/post/step"
querystring = {"userName":"","recipeId":"","stepId":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/post/step"
queryString <- list(
userName = "",
recipeId = "",
stepId = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/recipe/post/step') do |req|
req.params['userName'] = ''
req.params['recipeId'] = ''
req.params['stepId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/post/step";
let querystring = [
("userName", ""),
("recipeId", ""),
("stepId", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId='
http POST '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/post/step?userName=&recipeId=&stepId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Update a recipe
{{baseUrl}}/recipe
BODY json
{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/recipe" {:content-type :json
:form-params {:ActiveMinutes 0
:AdTags ""
:AdminBoost 0
:AllCategoriesText ""
:BookmarkImageURL ""
:BookmarkSiteLogo ""
:BookmarkURL ""
:Category ""
:Collection ""
:CollectionID 0
:CreationDate ""
:Cuisine ""
:Description ""
:FavoriteCount 0
:HeroPhotoUrl ""
:ImageSquares []
:ImageURL ""
:Ingredients [{:DisplayIndex 0
:DisplayQuantity ""
:HTMLName ""
:IngredientID 0
:IngredientInfo {:Department ""
:MasterIngredientID 0
:Name ""
:UsuallyOnHand false}
:IsHeading false
:IsLinked false
:MetricDisplayQuantity ""
:MetricQuantity ""
:MetricUnit ""
:Name ""
:PreparationNotes ""
:Quantity ""
:Unit ""}]
:IngredientsTextBlock ""
:Instructions ""
:IsBookmark false
:IsPrivate false
:IsRecipeScan false
:IsSponsored false
:LastModified ""
:MaxImageSquare 0
:MedalCount 0
:MenuCount 0
:Microcategory ""
:NotesCount 0
:NutritionInfo {:CaloriesFromFat ""
:Cholesterol ""
:CholesterolPct ""
:DietaryFiber ""
:DietaryFiberPct ""
:MonoFat ""
:PolyFat ""
:Potassium ""
:PotassiumPct ""
:Protein ""
:ProteinPct ""
:SatFat ""
:SatFatPct ""
:SingularYieldUnit ""
:Sodium ""
:SodiumPct ""
:Sugar ""
:TotalCalories ""
:TotalCarbs ""
:TotalCarbsPct ""
:TotalFat ""
:TotalFatPct ""
:TransFat ""}
:Poster {:FirstName ""
:ImageUrl48 ""
:IsKitchenHelper false
:IsPremium false
:IsUsingRecurly false
:LastName ""
:MemberSince ""
:PhotoUrl ""
:PhotoUrl48 ""
:PremiumExpiryDate ""
:UserID 0
:UserName ""
:WebUrl ""}
:PrimaryIngredient ""
:RecipeID 0
:ReviewCount 0
:StarRating ""
:Subcategory ""
:Title ""
:TotalMinutes 0
:VariantOfRecipeID 0
:VerifiedByClass ""
:VerifiedDateTime ""
:WebURL ""
:YieldNumber ""
:YieldUnit ""}})
require "http/client"
url = "{{baseUrl}}/recipe"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/recipe"),
Content = new StringContent("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\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}}/recipe");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe"
payload := strings.NewReader("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/recipe HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2261
{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/recipe")
.setHeader("content-type", "application/json")
.setBody("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\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 \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/recipe")
.header("content-type", "application/json")
.body("{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}")
.asString();
const data = JSON.stringify({
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {
Department: '',
MasterIngredientID: 0,
Name: '',
UsuallyOnHand: false
},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/recipe');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe',
headers: {'content-type': 'application/json'},
data: {
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {Department: '', MasterIngredientID: 0, Name: '', UsuallyOnHand: false},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"AdTags":"","AdminBoost":0,"AllCategoriesText":"","BookmarkImageURL":"","BookmarkSiteLogo":"","BookmarkURL":"","Category":"","Collection":"","CollectionID":0,"CreationDate":"","Cuisine":"","Description":"","FavoriteCount":0,"HeroPhotoUrl":"","ImageSquares":[],"ImageURL":"","Ingredients":[{"DisplayIndex":0,"DisplayQuantity":"","HTMLName":"","IngredientID":0,"IngredientInfo":{"Department":"","MasterIngredientID":0,"Name":"","UsuallyOnHand":false},"IsHeading":false,"IsLinked":false,"MetricDisplayQuantity":"","MetricQuantity":"","MetricUnit":"","Name":"","PreparationNotes":"","Quantity":"","Unit":""}],"IngredientsTextBlock":"","Instructions":"","IsBookmark":false,"IsPrivate":false,"IsRecipeScan":false,"IsSponsored":false,"LastModified":"","MaxImageSquare":0,"MedalCount":0,"MenuCount":0,"Microcategory":"","NotesCount":0,"NutritionInfo":{"CaloriesFromFat":"","Cholesterol":"","CholesterolPct":"","DietaryFiber":"","DietaryFiberPct":"","MonoFat":"","PolyFat":"","Potassium":"","PotassiumPct":"","Protein":"","ProteinPct":"","SatFat":"","SatFatPct":"","SingularYieldUnit":"","Sodium":"","SodiumPct":"","Sugar":"","TotalCalories":"","TotalCarbs":"","TotalCarbsPct":"","TotalFat":"","TotalFatPct":"","TransFat":""},"Poster":{"FirstName":"","ImageUrl48":"","IsKitchenHelper":false,"IsPremium":false,"IsUsingRecurly":false,"LastName":"","MemberSince":"","PhotoUrl":"","PhotoUrl48":"","PremiumExpiryDate":"","UserID":0,"UserName":"","WebUrl":""},"PrimaryIngredient":"","RecipeID":0,"ReviewCount":0,"StarRating":"","Subcategory":"","Title":"","TotalMinutes":0,"VariantOfRecipeID":0,"VerifiedByClass":"","VerifiedDateTime":"","WebURL":"","YieldNumber":"","YieldUnit":""}'
};
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}}/recipe',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ActiveMinutes": 0,\n "AdTags": "",\n "AdminBoost": 0,\n "AllCategoriesText": "",\n "BookmarkImageURL": "",\n "BookmarkSiteLogo": "",\n "BookmarkURL": "",\n "Category": "",\n "Collection": "",\n "CollectionID": 0,\n "CreationDate": "",\n "Cuisine": "",\n "Description": "",\n "FavoriteCount": 0,\n "HeroPhotoUrl": "",\n "ImageSquares": [],\n "ImageURL": "",\n "Ingredients": [\n {\n "DisplayIndex": 0,\n "DisplayQuantity": "",\n "HTMLName": "",\n "IngredientID": 0,\n "IngredientInfo": {\n "Department": "",\n "MasterIngredientID": 0,\n "Name": "",\n "UsuallyOnHand": false\n },\n "IsHeading": false,\n "IsLinked": false,\n "MetricDisplayQuantity": "",\n "MetricQuantity": "",\n "MetricUnit": "",\n "Name": "",\n "PreparationNotes": "",\n "Quantity": "",\n "Unit": ""\n }\n ],\n "IngredientsTextBlock": "",\n "Instructions": "",\n "IsBookmark": false,\n "IsPrivate": false,\n "IsRecipeScan": false,\n "IsSponsored": false,\n "LastModified": "",\n "MaxImageSquare": 0,\n "MedalCount": 0,\n "MenuCount": 0,\n "Microcategory": "",\n "NotesCount": 0,\n "NutritionInfo": {\n "CaloriesFromFat": "",\n "Cholesterol": "",\n "CholesterolPct": "",\n "DietaryFiber": "",\n "DietaryFiberPct": "",\n "MonoFat": "",\n "PolyFat": "",\n "Potassium": "",\n "PotassiumPct": "",\n "Protein": "",\n "ProteinPct": "",\n "SatFat": "",\n "SatFatPct": "",\n "SingularYieldUnit": "",\n "Sodium": "",\n "SodiumPct": "",\n "Sugar": "",\n "TotalCalories": "",\n "TotalCarbs": "",\n "TotalCarbsPct": "",\n "TotalFat": "",\n "TotalFatPct": "",\n "TransFat": ""\n },\n "Poster": {\n "FirstName": "",\n "ImageUrl48": "",\n "IsKitchenHelper": false,\n "IsPremium": false,\n "IsUsingRecurly": false,\n "LastName": "",\n "MemberSince": "",\n "PhotoUrl": "",\n "PhotoUrl48": "",\n "PremiumExpiryDate": "",\n "UserID": 0,\n "UserName": "",\n "WebUrl": ""\n },\n "PrimaryIngredient": "",\n "RecipeID": 0,\n "ReviewCount": 0,\n "StarRating": "",\n "Subcategory": "",\n "Title": "",\n "TotalMinutes": 0,\n "VariantOfRecipeID": 0,\n "VerifiedByClass": "",\n "VerifiedDateTime": "",\n "WebURL": "",\n "YieldNumber": "",\n "YieldUnit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {Department: '', MasterIngredientID: 0, Name: '', UsuallyOnHand: false},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe',
headers: {'content-type': 'application/json'},
body: {
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {Department: '', MasterIngredientID: 0, Name: '', UsuallyOnHand: false},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/recipe');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {
Department: '',
MasterIngredientID: 0,
Name: '',
UsuallyOnHand: false
},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe',
headers: {'content-type': 'application/json'},
data: {
ActiveMinutes: 0,
AdTags: '',
AdminBoost: 0,
AllCategoriesText: '',
BookmarkImageURL: '',
BookmarkSiteLogo: '',
BookmarkURL: '',
Category: '',
Collection: '',
CollectionID: 0,
CreationDate: '',
Cuisine: '',
Description: '',
FavoriteCount: 0,
HeroPhotoUrl: '',
ImageSquares: [],
ImageURL: '',
Ingredients: [
{
DisplayIndex: 0,
DisplayQuantity: '',
HTMLName: '',
IngredientID: 0,
IngredientInfo: {Department: '', MasterIngredientID: 0, Name: '', UsuallyOnHand: false},
IsHeading: false,
IsLinked: false,
MetricDisplayQuantity: '',
MetricQuantity: '',
MetricUnit: '',
Name: '',
PreparationNotes: '',
Quantity: '',
Unit: ''
}
],
IngredientsTextBlock: '',
Instructions: '',
IsBookmark: false,
IsPrivate: false,
IsRecipeScan: false,
IsSponsored: false,
LastModified: '',
MaxImageSquare: 0,
MedalCount: 0,
MenuCount: 0,
Microcategory: '',
NotesCount: 0,
NutritionInfo: {
CaloriesFromFat: '',
Cholesterol: '',
CholesterolPct: '',
DietaryFiber: '',
DietaryFiberPct: '',
MonoFat: '',
PolyFat: '',
Potassium: '',
PotassiumPct: '',
Protein: '',
ProteinPct: '',
SatFat: '',
SatFatPct: '',
SingularYieldUnit: '',
Sodium: '',
SodiumPct: '',
Sugar: '',
TotalCalories: '',
TotalCarbs: '',
TotalCarbsPct: '',
TotalFat: '',
TotalFatPct: '',
TransFat: ''
},
Poster: {
FirstName: '',
ImageUrl48: '',
IsKitchenHelper: false,
IsPremium: false,
IsUsingRecurly: false,
LastName: '',
MemberSince: '',
PhotoUrl: '',
PhotoUrl48: '',
PremiumExpiryDate: '',
UserID: 0,
UserName: '',
WebUrl: ''
},
PrimaryIngredient: '',
RecipeID: 0,
ReviewCount: 0,
StarRating: '',
Subcategory: '',
Title: '',
TotalMinutes: 0,
VariantOfRecipeID: 0,
VerifiedByClass: '',
VerifiedDateTime: '',
WebURL: '',
YieldNumber: '',
YieldUnit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"AdTags":"","AdminBoost":0,"AllCategoriesText":"","BookmarkImageURL":"","BookmarkSiteLogo":"","BookmarkURL":"","Category":"","Collection":"","CollectionID":0,"CreationDate":"","Cuisine":"","Description":"","FavoriteCount":0,"HeroPhotoUrl":"","ImageSquares":[],"ImageURL":"","Ingredients":[{"DisplayIndex":0,"DisplayQuantity":"","HTMLName":"","IngredientID":0,"IngredientInfo":{"Department":"","MasterIngredientID":0,"Name":"","UsuallyOnHand":false},"IsHeading":false,"IsLinked":false,"MetricDisplayQuantity":"","MetricQuantity":"","MetricUnit":"","Name":"","PreparationNotes":"","Quantity":"","Unit":""}],"IngredientsTextBlock":"","Instructions":"","IsBookmark":false,"IsPrivate":false,"IsRecipeScan":false,"IsSponsored":false,"LastModified":"","MaxImageSquare":0,"MedalCount":0,"MenuCount":0,"Microcategory":"","NotesCount":0,"NutritionInfo":{"CaloriesFromFat":"","Cholesterol":"","CholesterolPct":"","DietaryFiber":"","DietaryFiberPct":"","MonoFat":"","PolyFat":"","Potassium":"","PotassiumPct":"","Protein":"","ProteinPct":"","SatFat":"","SatFatPct":"","SingularYieldUnit":"","Sodium":"","SodiumPct":"","Sugar":"","TotalCalories":"","TotalCarbs":"","TotalCarbsPct":"","TotalFat":"","TotalFatPct":"","TransFat":""},"Poster":{"FirstName":"","ImageUrl48":"","IsKitchenHelper":false,"IsPremium":false,"IsUsingRecurly":false,"LastName":"","MemberSince":"","PhotoUrl":"","PhotoUrl48":"","PremiumExpiryDate":"","UserID":0,"UserName":"","WebUrl":""},"PrimaryIngredient":"","RecipeID":0,"ReviewCount":0,"StarRating":"","Subcategory":"","Title":"","TotalMinutes":0,"VariantOfRecipeID":0,"VerifiedByClass":"","VerifiedDateTime":"","WebURL":"","YieldNumber":"","YieldUnit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ActiveMinutes": @0,
@"AdTags": @"",
@"AdminBoost": @0,
@"AllCategoriesText": @"",
@"BookmarkImageURL": @"",
@"BookmarkSiteLogo": @"",
@"BookmarkURL": @"",
@"Category": @"",
@"Collection": @"",
@"CollectionID": @0,
@"CreationDate": @"",
@"Cuisine": @"",
@"Description": @"",
@"FavoriteCount": @0,
@"HeroPhotoUrl": @"",
@"ImageSquares": @[ ],
@"ImageURL": @"",
@"Ingredients": @[ @{ @"DisplayIndex": @0, @"DisplayQuantity": @"", @"HTMLName": @"", @"IngredientID": @0, @"IngredientInfo": @{ @"Department": @"", @"MasterIngredientID": @0, @"Name": @"", @"UsuallyOnHand": @NO }, @"IsHeading": @NO, @"IsLinked": @NO, @"MetricDisplayQuantity": @"", @"MetricQuantity": @"", @"MetricUnit": @"", @"Name": @"", @"PreparationNotes": @"", @"Quantity": @"", @"Unit": @"" } ],
@"IngredientsTextBlock": @"",
@"Instructions": @"",
@"IsBookmark": @NO,
@"IsPrivate": @NO,
@"IsRecipeScan": @NO,
@"IsSponsored": @NO,
@"LastModified": @"",
@"MaxImageSquare": @0,
@"MedalCount": @0,
@"MenuCount": @0,
@"Microcategory": @"",
@"NotesCount": @0,
@"NutritionInfo": @{ @"CaloriesFromFat": @"", @"Cholesterol": @"", @"CholesterolPct": @"", @"DietaryFiber": @"", @"DietaryFiberPct": @"", @"MonoFat": @"", @"PolyFat": @"", @"Potassium": @"", @"PotassiumPct": @"", @"Protein": @"", @"ProteinPct": @"", @"SatFat": @"", @"SatFatPct": @"", @"SingularYieldUnit": @"", @"Sodium": @"", @"SodiumPct": @"", @"Sugar": @"", @"TotalCalories": @"", @"TotalCarbs": @"", @"TotalCarbsPct": @"", @"TotalFat": @"", @"TotalFatPct": @"", @"TransFat": @"" },
@"Poster": @{ @"FirstName": @"", @"ImageUrl48": @"", @"IsKitchenHelper": @NO, @"IsPremium": @NO, @"IsUsingRecurly": @NO, @"LastName": @"", @"MemberSince": @"", @"PhotoUrl": @"", @"PhotoUrl48": @"", @"PremiumExpiryDate": @"", @"UserID": @0, @"UserName": @"", @"WebUrl": @"" },
@"PrimaryIngredient": @"",
@"RecipeID": @0,
@"ReviewCount": @0,
@"StarRating": @"",
@"Subcategory": @"",
@"Title": @"",
@"TotalMinutes": @0,
@"VariantOfRecipeID": @0,
@"VerifiedByClass": @"",
@"VerifiedDateTime": @"",
@"WebURL": @"",
@"YieldNumber": @"",
@"YieldUnit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/recipe" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ActiveMinutes' => 0,
'AdTags' => '',
'AdminBoost' => 0,
'AllCategoriesText' => '',
'BookmarkImageURL' => '',
'BookmarkSiteLogo' => '',
'BookmarkURL' => '',
'Category' => '',
'Collection' => '',
'CollectionID' => 0,
'CreationDate' => '',
'Cuisine' => '',
'Description' => '',
'FavoriteCount' => 0,
'HeroPhotoUrl' => '',
'ImageSquares' => [
],
'ImageURL' => '',
'Ingredients' => [
[
'DisplayIndex' => 0,
'DisplayQuantity' => '',
'HTMLName' => '',
'IngredientID' => 0,
'IngredientInfo' => [
'Department' => '',
'MasterIngredientID' => 0,
'Name' => '',
'UsuallyOnHand' => null
],
'IsHeading' => null,
'IsLinked' => null,
'MetricDisplayQuantity' => '',
'MetricQuantity' => '',
'MetricUnit' => '',
'Name' => '',
'PreparationNotes' => '',
'Quantity' => '',
'Unit' => ''
]
],
'IngredientsTextBlock' => '',
'Instructions' => '',
'IsBookmark' => null,
'IsPrivate' => null,
'IsRecipeScan' => null,
'IsSponsored' => null,
'LastModified' => '',
'MaxImageSquare' => 0,
'MedalCount' => 0,
'MenuCount' => 0,
'Microcategory' => '',
'NotesCount' => 0,
'NutritionInfo' => [
'CaloriesFromFat' => '',
'Cholesterol' => '',
'CholesterolPct' => '',
'DietaryFiber' => '',
'DietaryFiberPct' => '',
'MonoFat' => '',
'PolyFat' => '',
'Potassium' => '',
'PotassiumPct' => '',
'Protein' => '',
'ProteinPct' => '',
'SatFat' => '',
'SatFatPct' => '',
'SingularYieldUnit' => '',
'Sodium' => '',
'SodiumPct' => '',
'Sugar' => '',
'TotalCalories' => '',
'TotalCarbs' => '',
'TotalCarbsPct' => '',
'TotalFat' => '',
'TotalFatPct' => '',
'TransFat' => ''
],
'Poster' => [
'FirstName' => '',
'ImageUrl48' => '',
'IsKitchenHelper' => null,
'IsPremium' => null,
'IsUsingRecurly' => null,
'LastName' => '',
'MemberSince' => '',
'PhotoUrl' => '',
'PhotoUrl48' => '',
'PremiumExpiryDate' => '',
'UserID' => 0,
'UserName' => '',
'WebUrl' => ''
],
'PrimaryIngredient' => '',
'RecipeID' => 0,
'ReviewCount' => 0,
'StarRating' => '',
'Subcategory' => '',
'Title' => '',
'TotalMinutes' => 0,
'VariantOfRecipeID' => 0,
'VerifiedByClass' => '',
'VerifiedDateTime' => '',
'WebURL' => '',
'YieldNumber' => '',
'YieldUnit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/recipe', [
'body' => '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ActiveMinutes' => 0,
'AdTags' => '',
'AdminBoost' => 0,
'AllCategoriesText' => '',
'BookmarkImageURL' => '',
'BookmarkSiteLogo' => '',
'BookmarkURL' => '',
'Category' => '',
'Collection' => '',
'CollectionID' => 0,
'CreationDate' => '',
'Cuisine' => '',
'Description' => '',
'FavoriteCount' => 0,
'HeroPhotoUrl' => '',
'ImageSquares' => [
],
'ImageURL' => '',
'Ingredients' => [
[
'DisplayIndex' => 0,
'DisplayQuantity' => '',
'HTMLName' => '',
'IngredientID' => 0,
'IngredientInfo' => [
'Department' => '',
'MasterIngredientID' => 0,
'Name' => '',
'UsuallyOnHand' => null
],
'IsHeading' => null,
'IsLinked' => null,
'MetricDisplayQuantity' => '',
'MetricQuantity' => '',
'MetricUnit' => '',
'Name' => '',
'PreparationNotes' => '',
'Quantity' => '',
'Unit' => ''
]
],
'IngredientsTextBlock' => '',
'Instructions' => '',
'IsBookmark' => null,
'IsPrivate' => null,
'IsRecipeScan' => null,
'IsSponsored' => null,
'LastModified' => '',
'MaxImageSquare' => 0,
'MedalCount' => 0,
'MenuCount' => 0,
'Microcategory' => '',
'NotesCount' => 0,
'NutritionInfo' => [
'CaloriesFromFat' => '',
'Cholesterol' => '',
'CholesterolPct' => '',
'DietaryFiber' => '',
'DietaryFiberPct' => '',
'MonoFat' => '',
'PolyFat' => '',
'Potassium' => '',
'PotassiumPct' => '',
'Protein' => '',
'ProteinPct' => '',
'SatFat' => '',
'SatFatPct' => '',
'SingularYieldUnit' => '',
'Sodium' => '',
'SodiumPct' => '',
'Sugar' => '',
'TotalCalories' => '',
'TotalCarbs' => '',
'TotalCarbsPct' => '',
'TotalFat' => '',
'TotalFatPct' => '',
'TransFat' => ''
],
'Poster' => [
'FirstName' => '',
'ImageUrl48' => '',
'IsKitchenHelper' => null,
'IsPremium' => null,
'IsUsingRecurly' => null,
'LastName' => '',
'MemberSince' => '',
'PhotoUrl' => '',
'PhotoUrl48' => '',
'PremiumExpiryDate' => '',
'UserID' => 0,
'UserName' => '',
'WebUrl' => ''
],
'PrimaryIngredient' => '',
'RecipeID' => 0,
'ReviewCount' => 0,
'StarRating' => '',
'Subcategory' => '',
'Title' => '',
'TotalMinutes' => 0,
'VariantOfRecipeID' => 0,
'VerifiedByClass' => '',
'VerifiedDateTime' => '',
'WebURL' => '',
'YieldNumber' => '',
'YieldUnit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ActiveMinutes' => 0,
'AdTags' => '',
'AdminBoost' => 0,
'AllCategoriesText' => '',
'BookmarkImageURL' => '',
'BookmarkSiteLogo' => '',
'BookmarkURL' => '',
'Category' => '',
'Collection' => '',
'CollectionID' => 0,
'CreationDate' => '',
'Cuisine' => '',
'Description' => '',
'FavoriteCount' => 0,
'HeroPhotoUrl' => '',
'ImageSquares' => [
],
'ImageURL' => '',
'Ingredients' => [
[
'DisplayIndex' => 0,
'DisplayQuantity' => '',
'HTMLName' => '',
'IngredientID' => 0,
'IngredientInfo' => [
'Department' => '',
'MasterIngredientID' => 0,
'Name' => '',
'UsuallyOnHand' => null
],
'IsHeading' => null,
'IsLinked' => null,
'MetricDisplayQuantity' => '',
'MetricQuantity' => '',
'MetricUnit' => '',
'Name' => '',
'PreparationNotes' => '',
'Quantity' => '',
'Unit' => ''
]
],
'IngredientsTextBlock' => '',
'Instructions' => '',
'IsBookmark' => null,
'IsPrivate' => null,
'IsRecipeScan' => null,
'IsSponsored' => null,
'LastModified' => '',
'MaxImageSquare' => 0,
'MedalCount' => 0,
'MenuCount' => 0,
'Microcategory' => '',
'NotesCount' => 0,
'NutritionInfo' => [
'CaloriesFromFat' => '',
'Cholesterol' => '',
'CholesterolPct' => '',
'DietaryFiber' => '',
'DietaryFiberPct' => '',
'MonoFat' => '',
'PolyFat' => '',
'Potassium' => '',
'PotassiumPct' => '',
'Protein' => '',
'ProteinPct' => '',
'SatFat' => '',
'SatFatPct' => '',
'SingularYieldUnit' => '',
'Sodium' => '',
'SodiumPct' => '',
'Sugar' => '',
'TotalCalories' => '',
'TotalCarbs' => '',
'TotalCarbsPct' => '',
'TotalFat' => '',
'TotalFatPct' => '',
'TransFat' => ''
],
'Poster' => [
'FirstName' => '',
'ImageUrl48' => '',
'IsKitchenHelper' => null,
'IsPremium' => null,
'IsUsingRecurly' => null,
'LastName' => '',
'MemberSince' => '',
'PhotoUrl' => '',
'PhotoUrl48' => '',
'PremiumExpiryDate' => '',
'UserID' => 0,
'UserName' => '',
'WebUrl' => ''
],
'PrimaryIngredient' => '',
'RecipeID' => 0,
'ReviewCount' => 0,
'StarRating' => '',
'Subcategory' => '',
'Title' => '',
'TotalMinutes' => 0,
'VariantOfRecipeID' => 0,
'VerifiedByClass' => '',
'VerifiedDateTime' => '',
'WebURL' => '',
'YieldNumber' => '',
'YieldUnit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/recipe');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/recipe", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe"
payload = {
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": False
},
"IsHeading": False,
"IsLinked": False,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": False,
"IsPrivate": False,
"IsRecipeScan": False,
"IsSponsored": False,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": False,
"IsPremium": False,
"IsUsingRecurly": False,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe"
payload <- "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/recipe') do |req|
req.body = "{\n \"ActiveMinutes\": 0,\n \"AdTags\": \"\",\n \"AdminBoost\": 0,\n \"AllCategoriesText\": \"\",\n \"BookmarkImageURL\": \"\",\n \"BookmarkSiteLogo\": \"\",\n \"BookmarkURL\": \"\",\n \"Category\": \"\",\n \"Collection\": \"\",\n \"CollectionID\": 0,\n \"CreationDate\": \"\",\n \"Cuisine\": \"\",\n \"Description\": \"\",\n \"FavoriteCount\": 0,\n \"HeroPhotoUrl\": \"\",\n \"ImageSquares\": [],\n \"ImageURL\": \"\",\n \"Ingredients\": [\n {\n \"DisplayIndex\": 0,\n \"DisplayQuantity\": \"\",\n \"HTMLName\": \"\",\n \"IngredientID\": 0,\n \"IngredientInfo\": {\n \"Department\": \"\",\n \"MasterIngredientID\": 0,\n \"Name\": \"\",\n \"UsuallyOnHand\": false\n },\n \"IsHeading\": false,\n \"IsLinked\": false,\n \"MetricDisplayQuantity\": \"\",\n \"MetricQuantity\": \"\",\n \"MetricUnit\": \"\",\n \"Name\": \"\",\n \"PreparationNotes\": \"\",\n \"Quantity\": \"\",\n \"Unit\": \"\"\n }\n ],\n \"IngredientsTextBlock\": \"\",\n \"Instructions\": \"\",\n \"IsBookmark\": false,\n \"IsPrivate\": false,\n \"IsRecipeScan\": false,\n \"IsSponsored\": false,\n \"LastModified\": \"\",\n \"MaxImageSquare\": 0,\n \"MedalCount\": 0,\n \"MenuCount\": 0,\n \"Microcategory\": \"\",\n \"NotesCount\": 0,\n \"NutritionInfo\": {\n \"CaloriesFromFat\": \"\",\n \"Cholesterol\": \"\",\n \"CholesterolPct\": \"\",\n \"DietaryFiber\": \"\",\n \"DietaryFiberPct\": \"\",\n \"MonoFat\": \"\",\n \"PolyFat\": \"\",\n \"Potassium\": \"\",\n \"PotassiumPct\": \"\",\n \"Protein\": \"\",\n \"ProteinPct\": \"\",\n \"SatFat\": \"\",\n \"SatFatPct\": \"\",\n \"SingularYieldUnit\": \"\",\n \"Sodium\": \"\",\n \"SodiumPct\": \"\",\n \"Sugar\": \"\",\n \"TotalCalories\": \"\",\n \"TotalCarbs\": \"\",\n \"TotalCarbsPct\": \"\",\n \"TotalFat\": \"\",\n \"TotalFatPct\": \"\",\n \"TransFat\": \"\"\n },\n \"Poster\": {\n \"FirstName\": \"\",\n \"ImageUrl48\": \"\",\n \"IsKitchenHelper\": false,\n \"IsPremium\": false,\n \"IsUsingRecurly\": false,\n \"LastName\": \"\",\n \"MemberSince\": \"\",\n \"PhotoUrl\": \"\",\n \"PhotoUrl48\": \"\",\n \"PremiumExpiryDate\": \"\",\n \"UserID\": 0,\n \"UserName\": \"\",\n \"WebUrl\": \"\"\n },\n \"PrimaryIngredient\": \"\",\n \"RecipeID\": 0,\n \"ReviewCount\": 0,\n \"StarRating\": \"\",\n \"Subcategory\": \"\",\n \"Title\": \"\",\n \"TotalMinutes\": 0,\n \"VariantOfRecipeID\": 0,\n \"VerifiedByClass\": \"\",\n \"VerifiedDateTime\": \"\",\n \"WebURL\": \"\",\n \"YieldNumber\": \"\",\n \"YieldUnit\": \"\"\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}}/recipe";
let payload = json!({
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": (),
"ImageURL": "",
"Ingredients": (
json!({
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": json!({
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
}),
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
})
),
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": json!({
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
}),
"Poster": json!({
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
}),
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/recipe \
--header 'content-type: application/json' \
--data '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}'
echo '{
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
{
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": {
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
},
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
}
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": {
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
},
"Poster": {
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
},
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
}' | \
http PUT {{baseUrl}}/recipe \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ActiveMinutes": 0,\n "AdTags": "",\n "AdminBoost": 0,\n "AllCategoriesText": "",\n "BookmarkImageURL": "",\n "BookmarkSiteLogo": "",\n "BookmarkURL": "",\n "Category": "",\n "Collection": "",\n "CollectionID": 0,\n "CreationDate": "",\n "Cuisine": "",\n "Description": "",\n "FavoriteCount": 0,\n "HeroPhotoUrl": "",\n "ImageSquares": [],\n "ImageURL": "",\n "Ingredients": [\n {\n "DisplayIndex": 0,\n "DisplayQuantity": "",\n "HTMLName": "",\n "IngredientID": 0,\n "IngredientInfo": {\n "Department": "",\n "MasterIngredientID": 0,\n "Name": "",\n "UsuallyOnHand": false\n },\n "IsHeading": false,\n "IsLinked": false,\n "MetricDisplayQuantity": "",\n "MetricQuantity": "",\n "MetricUnit": "",\n "Name": "",\n "PreparationNotes": "",\n "Quantity": "",\n "Unit": ""\n }\n ],\n "IngredientsTextBlock": "",\n "Instructions": "",\n "IsBookmark": false,\n "IsPrivate": false,\n "IsRecipeScan": false,\n "IsSponsored": false,\n "LastModified": "",\n "MaxImageSquare": 0,\n "MedalCount": 0,\n "MenuCount": 0,\n "Microcategory": "",\n "NotesCount": 0,\n "NutritionInfo": {\n "CaloriesFromFat": "",\n "Cholesterol": "",\n "CholesterolPct": "",\n "DietaryFiber": "",\n "DietaryFiberPct": "",\n "MonoFat": "",\n "PolyFat": "",\n "Potassium": "",\n "PotassiumPct": "",\n "Protein": "",\n "ProteinPct": "",\n "SatFat": "",\n "SatFatPct": "",\n "SingularYieldUnit": "",\n "Sodium": "",\n "SodiumPct": "",\n "Sugar": "",\n "TotalCalories": "",\n "TotalCarbs": "",\n "TotalCarbsPct": "",\n "TotalFat": "",\n "TotalFatPct": "",\n "TransFat": ""\n },\n "Poster": {\n "FirstName": "",\n "ImageUrl48": "",\n "IsKitchenHelper": false,\n "IsPremium": false,\n "IsUsingRecurly": false,\n "LastName": "",\n "MemberSince": "",\n "PhotoUrl": "",\n "PhotoUrl48": "",\n "PremiumExpiryDate": "",\n "UserID": 0,\n "UserName": "",\n "WebUrl": ""\n },\n "PrimaryIngredient": "",\n "RecipeID": 0,\n "ReviewCount": 0,\n "StarRating": "",\n "Subcategory": "",\n "Title": "",\n "TotalMinutes": 0,\n "VariantOfRecipeID": 0,\n "VerifiedByClass": "",\n "VerifiedDateTime": "",\n "WebURL": "",\n "YieldNumber": "",\n "YieldUnit": ""\n}' \
--output-document \
- {{baseUrl}}/recipe
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ActiveMinutes": 0,
"AdTags": "",
"AdminBoost": 0,
"AllCategoriesText": "",
"BookmarkImageURL": "",
"BookmarkSiteLogo": "",
"BookmarkURL": "",
"Category": "",
"Collection": "",
"CollectionID": 0,
"CreationDate": "",
"Cuisine": "",
"Description": "",
"FavoriteCount": 0,
"HeroPhotoUrl": "",
"ImageSquares": [],
"ImageURL": "",
"Ingredients": [
[
"DisplayIndex": 0,
"DisplayQuantity": "",
"HTMLName": "",
"IngredientID": 0,
"IngredientInfo": [
"Department": "",
"MasterIngredientID": 0,
"Name": "",
"UsuallyOnHand": false
],
"IsHeading": false,
"IsLinked": false,
"MetricDisplayQuantity": "",
"MetricQuantity": "",
"MetricUnit": "",
"Name": "",
"PreparationNotes": "",
"Quantity": "",
"Unit": ""
]
],
"IngredientsTextBlock": "",
"Instructions": "",
"IsBookmark": false,
"IsPrivate": false,
"IsRecipeScan": false,
"IsSponsored": false,
"LastModified": "",
"MaxImageSquare": 0,
"MedalCount": 0,
"MenuCount": 0,
"Microcategory": "",
"NotesCount": 0,
"NutritionInfo": [
"CaloriesFromFat": "",
"Cholesterol": "",
"CholesterolPct": "",
"DietaryFiber": "",
"DietaryFiberPct": "",
"MonoFat": "",
"PolyFat": "",
"Potassium": "",
"PotassiumPct": "",
"Protein": "",
"ProteinPct": "",
"SatFat": "",
"SatFatPct": "",
"SingularYieldUnit": "",
"Sodium": "",
"SodiumPct": "",
"Sugar": "",
"TotalCalories": "",
"TotalCarbs": "",
"TotalCarbsPct": "",
"TotalFat": "",
"TotalFatPct": "",
"TransFat": ""
],
"Poster": [
"FirstName": "",
"ImageUrl48": "",
"IsKitchenHelper": false,
"IsPremium": false,
"IsUsingRecurly": false,
"LastName": "",
"MemberSince": "",
"PhotoUrl": "",
"PhotoUrl48": "",
"PremiumExpiryDate": "",
"UserID": 0,
"UserName": "",
"WebUrl": ""
],
"PrimaryIngredient": "",
"RecipeID": 0,
"ReviewCount": 0,
"StarRating": "",
"Subcategory": "",
"Title": "",
"TotalMinutes": 0,
"VariantOfRecipeID": 0,
"VerifiedByClass": "",
"VerifiedDateTime": "",
"WebURL": "",
"YieldNumber": "",
"YieldUnit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Zaps the recipe.
{{baseUrl}}/recipe/:id/zap
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:id/zap");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:id/zap")
require "http/client"
url = "{{baseUrl}}/recipe/:id/zap"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:id/zap"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:id/zap");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:id/zap"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:id/zap HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:id/zap")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:id/zap"))
.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}}/recipe/:id/zap")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:id/zap")
.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}}/recipe/:id/zap');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:id/zap'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:id/zap';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:id/zap',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:id/zap")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:id/zap',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:id/zap'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:id/zap');
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}}/recipe/:id/zap'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:id/zap';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:id/zap"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:id/zap" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:id/zap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:id/zap');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:id/zap');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:id/zap');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:id/zap' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:id/zap' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:id/zap")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:id/zap"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:id/zap"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:id/zap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:id/zap') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:id/zap";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:id/zap
http GET {{baseUrl}}/recipe/:id/zap
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:id/zap
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:id/zap")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Add a new review. Only one review can be provided per {userId, recipeId} pair. Otherwise your review will be updated.
{{baseUrl}}/recipe/:recipeId/review
QUERY PARAMS
recipeId
BODY json
{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/review");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/recipe/:recipeId/review" {:content-type :json
:form-params {:ActiveMinutes 0
:Comment ""
:MakeAgain ""
:StarRating 0
:TotalMinutes 0}})
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/review"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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}}/recipe/:recipeId/review"),
Content = new StringContent("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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}}/recipe/:recipeId/review");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/review"
payload := strings.NewReader("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/recipe/:recipeId/review HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 100
{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/recipe/:recipeId/review")
.setHeader("content-type", "application/json")
.setBody("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/review"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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 \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/review")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/recipe/:recipeId/review")
.header("content-type", "application/json")
.body("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
.asString();
const data = JSON.stringify({
ActiveMinutes: 0,
Comment: '',
MakeAgain: '',
StarRating: 0,
TotalMinutes: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/recipe/:recipeId/review');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/:recipeId/review',
headers: {'content-type': 'application/json'},
data: {ActiveMinutes: 0, Comment: '', MakeAgain: '', StarRating: 0, TotalMinutes: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/review';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"Comment":"","MakeAgain":"","StarRating":0,"TotalMinutes":0}'
};
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}}/recipe/:recipeId/review',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ActiveMinutes": 0,\n "Comment": "",\n "MakeAgain": "",\n "StarRating": 0,\n "TotalMinutes": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/review")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/review',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ActiveMinutes: 0, Comment: '', MakeAgain: '', StarRating: 0, TotalMinutes: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/:recipeId/review',
headers: {'content-type': 'application/json'},
body: {ActiveMinutes: 0, Comment: '', MakeAgain: '', StarRating: 0, TotalMinutes: 0},
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}}/recipe/:recipeId/review');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ActiveMinutes: 0,
Comment: '',
MakeAgain: '',
StarRating: 0,
TotalMinutes: 0
});
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}}/recipe/:recipeId/review',
headers: {'content-type': 'application/json'},
data: {ActiveMinutes: 0, Comment: '', MakeAgain: '', StarRating: 0, TotalMinutes: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/review';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"Comment":"","MakeAgain":"","StarRating":0,"TotalMinutes":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ActiveMinutes": @0,
@"Comment": @"",
@"MakeAgain": @"",
@"StarRating": @0,
@"TotalMinutes": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/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}}/recipe/:recipeId/review" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/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([
'ActiveMinutes' => 0,
'Comment' => '',
'MakeAgain' => '',
'StarRating' => 0,
'TotalMinutes' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/recipe/:recipeId/review', [
'body' => '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/review');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ActiveMinutes' => 0,
'Comment' => '',
'MakeAgain' => '',
'StarRating' => 0,
'TotalMinutes' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ActiveMinutes' => 0,
'Comment' => '',
'MakeAgain' => '',
'StarRating' => 0,
'TotalMinutes' => 0
]));
$request->setRequestUrl('{{baseUrl}}/recipe/:recipeId/review');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/review' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/review' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/recipe/:recipeId/review", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/review"
payload = {
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/review"
payload <- "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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}}/recipe/:recipeId/review")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/recipe/:recipeId/review') do |req|
req.body = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/review";
let payload = json!({
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/recipe/:recipeId/review \
--header 'content-type: application/json' \
--data '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}'
echo '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}' | \
http POST {{baseUrl}}/recipe/:recipeId/review \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ActiveMinutes": 0,\n "Comment": "",\n "MakeAgain": "",\n "StarRating": 0,\n "TotalMinutes": 0\n}' \
--output-document \
- {{baseUrl}}/recipe/:recipeId/review
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/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()
DELETE
DELETE a reply to a given review. Authenticated user must be the one who originally posted the reply.
{{baseUrl}}/recipe/review/replies/:replyId
QUERY PARAMS
replyId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/review/replies/:replyId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/recipe/review/replies/:replyId")
require "http/client"
url = "{{baseUrl}}/recipe/review/replies/:replyId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/recipe/review/replies/:replyId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/review/replies/:replyId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/review/replies/:replyId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/recipe/review/replies/:replyId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/recipe/review/replies/:replyId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/review/replies/:replyId"))
.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}}/recipe/review/replies/:replyId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/recipe/review/replies/:replyId")
.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}}/recipe/review/replies/:replyId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/recipe/review/replies/:replyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/review/replies/:replyId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/review/replies/:replyId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/review/replies/:replyId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/review/replies/:replyId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/recipe/review/replies/:replyId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/recipe/review/replies/:replyId');
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}}/recipe/review/replies/:replyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/review/replies/:replyId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/review/replies/:replyId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/review/replies/:replyId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/review/replies/:replyId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/recipe/review/replies/:replyId');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/review/replies/:replyId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/review/replies/:replyId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/review/replies/:replyId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/review/replies/:replyId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/recipe/review/replies/:replyId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/review/replies/:replyId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/review/replies/:replyId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/review/replies/:replyId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/recipe/review/replies/:replyId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/review/replies/:replyId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/recipe/review/replies/:replyId
http DELETE {{baseUrl}}/recipe/review/replies/:replyId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/recipe/review/replies/:replyId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/review/replies/:replyId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
DEPRECATED! - Deletes a review by recipeId and reviewId. Please use recipe-review-{reviewId} instead.
{{baseUrl}}/recipe/:recipeId/review/:reviewId
QUERY PARAMS
recipeId
reviewId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/review/:reviewId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/recipe/:recipeId/review/:reviewId")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/review/:reviewId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/review/:reviewId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/review/:reviewId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/review/:reviewId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/recipe/:recipeId/review/:reviewId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/recipe/:recipeId/review/:reviewId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/review/:reviewId"))
.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}}/recipe/:recipeId/review/:reviewId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/recipe/:recipeId/review/:reviewId")
.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}}/recipe/:recipeId/review/:reviewId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/recipe/:recipeId/review/:reviewId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/review/:reviewId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/review/:reviewId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/review/:reviewId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/review/:reviewId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/recipe/:recipeId/review/:reviewId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/recipe/:recipeId/review/:reviewId');
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}}/recipe/:recipeId/review/:reviewId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/review/:reviewId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/review/:reviewId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/review/:reviewId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/review/:reviewId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/recipe/:recipeId/review/:reviewId');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/review/:reviewId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/review/:reviewId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/review/:reviewId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/review/:reviewId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/recipe/:recipeId/review/:reviewId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/review/:reviewId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/review/:reviewId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/review/:reviewId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/recipe/:recipeId/review/:reviewId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/review/:reviewId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/recipe/:recipeId/review/:reviewId
http DELETE {{baseUrl}}/recipe/:recipeId/review/:reviewId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/recipe/:recipeId/review/:reviewId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/review/:reviewId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get -my- review for the recipe {recipeId}, where -me- is determined by standard authentication headers
{{baseUrl}}/recipe/:recipeId/review
QUERY PARAMS
recipeId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/review");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:recipeId/review")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/review"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/review"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/review");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/review"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:recipeId/review HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:recipeId/review")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/review"))
.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}}/recipe/:recipeId/review")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:recipeId/review")
.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}}/recipe/:recipeId/review');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/review'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/review';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/review',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/review")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/review',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/review'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:recipeId/review');
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}}/recipe/:recipeId/review'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/review';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/review"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/review" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/review",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:recipeId/review');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/review');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/review');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/review' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/review' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:recipeId/review")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/review"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/review"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/review")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:recipeId/review') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/review";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:recipeId/review
http GET {{baseUrl}}/recipe/:recipeId/review
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:recipeId/review
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/review")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get a given review by string-style ID. This will return a payload with FeaturedReply, ReplyCount. Recommended display is to list top-level reviews with one featured reply underneath. Currently, the FeaturedReply is the most recent one for that rating.
{{baseUrl}}/recipe/review/:reviewId
QUERY PARAMS
reviewId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/review/:reviewId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/review/:reviewId")
require "http/client"
url = "{{baseUrl}}/recipe/review/:reviewId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/review/:reviewId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/review/:reviewId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/review/:reviewId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/review/:reviewId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/review/:reviewId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/review/:reviewId"))
.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}}/recipe/review/:reviewId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/review/:reviewId")
.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}}/recipe/review/:reviewId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/review/:reviewId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/review/:reviewId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/review/:reviewId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/review/:reviewId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/review/:reviewId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/review/:reviewId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/review/:reviewId');
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}}/recipe/review/:reviewId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/review/:reviewId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/review/:reviewId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/review/:reviewId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/review/:reviewId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/review/:reviewId');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/review/:reviewId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/review/:reviewId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/review/:reviewId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/review/:reviewId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/review/:reviewId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/review/:reviewId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/review/:reviewId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/review/:reviewId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/review/:reviewId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/review/:reviewId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/review/:reviewId
http GET {{baseUrl}}/recipe/review/:reviewId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/review/:reviewId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/review/:reviewId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get a paged list of replies for a given review.
{{baseUrl}}/recipe/review/:reviewId/replies
QUERY PARAMS
reviewId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/review/:reviewId/replies");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/review/:reviewId/replies")
require "http/client"
url = "{{baseUrl}}/recipe/review/:reviewId/replies"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/review/:reviewId/replies"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/review/:reviewId/replies");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/review/:reviewId/replies"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/review/:reviewId/replies HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/review/:reviewId/replies")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/review/:reviewId/replies"))
.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}}/recipe/review/:reviewId/replies")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/review/:reviewId/replies")
.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}}/recipe/review/:reviewId/replies');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/review/:reviewId/replies'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/review/:reviewId/replies';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/review/:reviewId/replies',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/review/:reviewId/replies")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/review/:reviewId/replies',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/recipe/review/:reviewId/replies'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/review/:reviewId/replies');
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}}/recipe/review/:reviewId/replies'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/review/:reviewId/replies';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/review/:reviewId/replies"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/review/:reviewId/replies" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/review/:reviewId/replies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/review/:reviewId/replies');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/review/:reviewId/replies');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/review/:reviewId/replies');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/review/:reviewId/replies' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/review/:reviewId/replies' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/review/:reviewId/replies")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/review/:reviewId/replies"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/review/:reviewId/replies"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/review/:reviewId/replies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/review/:reviewId/replies') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/review/:reviewId/replies";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/review/:reviewId/replies
http GET {{baseUrl}}/recipe/review/:reviewId/replies
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/review/:reviewId/replies
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/review/:reviewId/replies")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get paged list of reviews for a recipe. Each review will have at most one FeaturedReply, as well as a ReplyCount.
{{baseUrl}}/recipe/:recipeId/reviews
QUERY PARAMS
recipeId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/reviews");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/recipe/:recipeId/reviews")
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/reviews"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/reviews"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/recipe/:recipeId/reviews");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/reviews"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/recipe/:recipeId/reviews HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/recipe/:recipeId/reviews")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/reviews"))
.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}}/recipe/:recipeId/reviews")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/recipe/:recipeId/reviews")
.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}}/recipe/:recipeId/reviews');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/reviews'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/reviews';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/recipe/:recipeId/reviews',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/reviews")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/reviews',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/recipe/:recipeId/reviews'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/recipe/:recipeId/reviews');
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}}/recipe/:recipeId/reviews'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/reviews';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/reviews"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/recipe/:recipeId/reviews" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/reviews",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/recipe/:recipeId/reviews');
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/reviews');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/recipe/:recipeId/reviews');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/reviews' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/reviews' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/recipe/:recipeId/reviews")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/reviews"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/reviews"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/reviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/recipe/:recipeId/reviews') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/:recipeId/reviews";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/recipe/:recipeId/reviews
http GET {{baseUrl}}/recipe/:recipeId/reviews
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/recipe/:recipeId/reviews
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/reviews")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
HTTP PUT (update) a recipe review. DEPRECATED. Please see recipe-review-{reviewId} PUT for the new endpoint. We are moving to a string-based primary key system, no longer integers, for reviews and replies.
{{baseUrl}}/recipe/:recipeId/review/:reviewId
QUERY PARAMS
reviewId
recipeId
BODY json
{
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/:recipeId/review/:reviewId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/recipe/:recipeId/review/:reviewId" {:content-type :json
:form-params {:ActiveMinutes 0
:Comment ""
:GUID ""
:MakeAgain ""
:ParentID 0
:StarRating 0
:TotalMinutes 0}})
require "http/client"
url = "{{baseUrl}}/recipe/:recipeId/review/:reviewId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/recipe/:recipeId/review/:reviewId"),
Content = new StringContent("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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}}/recipe/:recipeId/review/:reviewId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/:recipeId/review/:reviewId"
payload := strings.NewReader("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/recipe/:recipeId/review/:reviewId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 131
{
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/recipe/:recipeId/review/:reviewId")
.setHeader("content-type", "application/json")
.setBody("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/:recipeId/review/:reviewId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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 \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/review/:reviewId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/recipe/:recipeId/review/:reviewId")
.header("content-type", "application/json")
.body("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
.asString();
const data = JSON.stringify({
ActiveMinutes: 0,
Comment: '',
GUID: '',
MakeAgain: '',
ParentID: 0,
StarRating: 0,
TotalMinutes: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/recipe/:recipeId/review/:reviewId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/:recipeId/review/:reviewId',
headers: {'content-type': 'application/json'},
data: {
ActiveMinutes: 0,
Comment: '',
GUID: '',
MakeAgain: '',
ParentID: 0,
StarRating: 0,
TotalMinutes: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/:recipeId/review/:reviewId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"Comment":"","GUID":"","MakeAgain":"","ParentID":0,"StarRating":0,"TotalMinutes":0}'
};
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}}/recipe/:recipeId/review/:reviewId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ActiveMinutes": 0,\n "Comment": "",\n "GUID": "",\n "MakeAgain": "",\n "ParentID": 0,\n "StarRating": 0,\n "TotalMinutes": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe/:recipeId/review/:reviewId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/:recipeId/review/:reviewId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
ActiveMinutes: 0,
Comment: '',
GUID: '',
MakeAgain: '',
ParentID: 0,
StarRating: 0,
TotalMinutes: 0
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/:recipeId/review/:reviewId',
headers: {'content-type': 'application/json'},
body: {
ActiveMinutes: 0,
Comment: '',
GUID: '',
MakeAgain: '',
ParentID: 0,
StarRating: 0,
TotalMinutes: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/recipe/:recipeId/review/:reviewId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ActiveMinutes: 0,
Comment: '',
GUID: '',
MakeAgain: '',
ParentID: 0,
StarRating: 0,
TotalMinutes: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/:recipeId/review/:reviewId',
headers: {'content-type': 'application/json'},
data: {
ActiveMinutes: 0,
Comment: '',
GUID: '',
MakeAgain: '',
ParentID: 0,
StarRating: 0,
TotalMinutes: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/:recipeId/review/:reviewId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"Comment":"","GUID":"","MakeAgain":"","ParentID":0,"StarRating":0,"TotalMinutes":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ActiveMinutes": @0,
@"Comment": @"",
@"GUID": @"",
@"MakeAgain": @"",
@"ParentID": @0,
@"StarRating": @0,
@"TotalMinutes": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/:recipeId/review/:reviewId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/recipe/:recipeId/review/:reviewId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/:recipeId/review/:reviewId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ActiveMinutes' => 0,
'Comment' => '',
'GUID' => '',
'MakeAgain' => '',
'ParentID' => 0,
'StarRating' => 0,
'TotalMinutes' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/recipe/:recipeId/review/:reviewId', [
'body' => '{
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/:recipeId/review/:reviewId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ActiveMinutes' => 0,
'Comment' => '',
'GUID' => '',
'MakeAgain' => '',
'ParentID' => 0,
'StarRating' => 0,
'TotalMinutes' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ActiveMinutes' => 0,
'Comment' => '',
'GUID' => '',
'MakeAgain' => '',
'ParentID' => 0,
'StarRating' => 0,
'TotalMinutes' => 0
]));
$request->setRequestUrl('{{baseUrl}}/recipe/:recipeId/review/:reviewId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/:recipeId/review/:reviewId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/:recipeId/review/:reviewId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/recipe/:recipeId/review/:reviewId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/:recipeId/review/:reviewId"
payload = {
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/:recipeId/review/:reviewId"
payload <- "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/:recipeId/review/:reviewId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/recipe/:recipeId/review/:reviewId') do |req|
req.body = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"GUID\": \"\",\n \"MakeAgain\": \"\",\n \"ParentID\": 0,\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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}}/recipe/:recipeId/review/:reviewId";
let payload = json!({
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/recipe/:recipeId/review/:reviewId \
--header 'content-type: application/json' \
--data '{
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
}'
echo '{
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
}' | \
http PUT {{baseUrl}}/recipe/:recipeId/review/:reviewId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ActiveMinutes": 0,\n "Comment": "",\n "GUID": "",\n "MakeAgain": "",\n "ParentID": 0,\n "StarRating": 0,\n "TotalMinutes": 0\n}' \
--output-document \
- {{baseUrl}}/recipe/:recipeId/review/:reviewId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ActiveMinutes": 0,
"Comment": "",
"GUID": "",
"MakeAgain": "",
"ParentID": 0,
"StarRating": 0,
"TotalMinutes": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/:recipeId/review/:reviewId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
POST a reply to a given review. The date will be set by server. Note that replies no longer have star ratings, only top-level reviews do.
{{baseUrl}}/recipe/review/:reviewId/replies
QUERY PARAMS
reviewId
BODY json
{
"Comment": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/review/:reviewId/replies");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Comment\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/recipe/review/:reviewId/replies" {:content-type :json
:form-params {:Comment ""}})
require "http/client"
url = "{{baseUrl}}/recipe/review/:reviewId/replies"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"Comment\": \"\"\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}}/recipe/review/:reviewId/replies"),
Content = new StringContent("{\n \"Comment\": \"\"\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}}/recipe/review/:reviewId/replies");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Comment\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/review/:reviewId/replies"
payload := strings.NewReader("{\n \"Comment\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/recipe/review/:reviewId/replies HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"Comment": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/recipe/review/:reviewId/replies")
.setHeader("content-type", "application/json")
.setBody("{\n \"Comment\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/review/:reviewId/replies"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Comment\": \"\"\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 \"Comment\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/review/:reviewId/replies")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/recipe/review/:reviewId/replies")
.header("content-type", "application/json")
.body("{\n \"Comment\": \"\"\n}")
.asString();
const data = JSON.stringify({
Comment: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/recipe/review/:reviewId/replies');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/review/:reviewId/replies',
headers: {'content-type': 'application/json'},
data: {Comment: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/review/:reviewId/replies';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"Comment":""}'
};
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}}/recipe/review/:reviewId/replies',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "Comment": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Comment\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe/review/:reviewId/replies")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/review/:reviewId/replies',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({Comment: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/recipe/review/:reviewId/replies',
headers: {'content-type': 'application/json'},
body: {Comment: ''},
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}}/recipe/review/:reviewId/replies');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
Comment: ''
});
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}}/recipe/review/:reviewId/replies',
headers: {'content-type': 'application/json'},
data: {Comment: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/review/:reviewId/replies';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"Comment":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Comment": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/review/:reviewId/replies"]
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}}/recipe/review/:reviewId/replies" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"Comment\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/review/:reviewId/replies",
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([
'Comment' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/recipe/review/:reviewId/replies', [
'body' => '{
"Comment": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/review/:reviewId/replies');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Comment' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Comment' => ''
]));
$request->setRequestUrl('{{baseUrl}}/recipe/review/:reviewId/replies');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/review/:reviewId/replies' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Comment": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/review/:reviewId/replies' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Comment": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Comment\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/recipe/review/:reviewId/replies", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/review/:reviewId/replies"
payload = { "Comment": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/review/:reviewId/replies"
payload <- "{\n \"Comment\": \"\"\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}}/recipe/review/:reviewId/replies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"Comment\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/recipe/review/:reviewId/replies') do |req|
req.body = "{\n \"Comment\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/recipe/review/:reviewId/replies";
let payload = json!({"Comment": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/recipe/review/:reviewId/replies \
--header 'content-type: application/json' \
--data '{
"Comment": ""
}'
echo '{
"Comment": ""
}' | \
http POST {{baseUrl}}/recipe/review/:reviewId/replies \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "Comment": ""\n}' \
--output-document \
- {{baseUrl}}/recipe/review/:reviewId/replies
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["Comment": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/review/:reviewId/replies")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Update (PUT) a reply to a given review. Authenticated user must be the original one that posted the reply.
{{baseUrl}}/recipe/review/replies/:replyId
QUERY PARAMS
replyId
BODY json
{
"Comment": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/review/replies/:replyId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Comment\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/recipe/review/replies/:replyId" {:content-type :json
:form-params {:Comment ""}})
require "http/client"
url = "{{baseUrl}}/recipe/review/replies/:replyId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"Comment\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/recipe/review/replies/:replyId"),
Content = new StringContent("{\n \"Comment\": \"\"\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}}/recipe/review/replies/:replyId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Comment\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/review/replies/:replyId"
payload := strings.NewReader("{\n \"Comment\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/recipe/review/replies/:replyId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"Comment": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/recipe/review/replies/:replyId")
.setHeader("content-type", "application/json")
.setBody("{\n \"Comment\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/review/replies/:replyId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"Comment\": \"\"\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 \"Comment\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/review/replies/:replyId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/recipe/review/replies/:replyId")
.header("content-type", "application/json")
.body("{\n \"Comment\": \"\"\n}")
.asString();
const data = JSON.stringify({
Comment: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/recipe/review/replies/:replyId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/review/replies/:replyId',
headers: {'content-type': 'application/json'},
data: {Comment: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/review/replies/:replyId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"Comment":""}'
};
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}}/recipe/review/replies/:replyId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "Comment": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Comment\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe/review/replies/:replyId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/review/replies/:replyId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({Comment: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/review/replies/:replyId',
headers: {'content-type': 'application/json'},
body: {Comment: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/recipe/review/replies/:replyId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
Comment: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/review/replies/:replyId',
headers: {'content-type': 'application/json'},
data: {Comment: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/review/replies/:replyId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"Comment":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Comment": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/review/replies/:replyId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/recipe/review/replies/:replyId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"Comment\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/review/replies/:replyId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'Comment' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/recipe/review/replies/:replyId', [
'body' => '{
"Comment": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/review/replies/:replyId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Comment' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Comment' => ''
]));
$request->setRequestUrl('{{baseUrl}}/recipe/review/replies/:replyId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/review/replies/:replyId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"Comment": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/review/replies/:replyId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"Comment": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Comment\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/recipe/review/replies/:replyId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/review/replies/:replyId"
payload = { "Comment": "" }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/review/replies/:replyId"
payload <- "{\n \"Comment\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/review/replies/:replyId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"Comment\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/recipe/review/replies/:replyId') do |req|
req.body = "{\n \"Comment\": \"\"\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}}/recipe/review/replies/:replyId";
let payload = json!({"Comment": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/recipe/review/replies/:replyId \
--header 'content-type: application/json' \
--data '{
"Comment": ""
}'
echo '{
"Comment": ""
}' | \
http PUT {{baseUrl}}/recipe/review/replies/:replyId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "Comment": ""\n}' \
--output-document \
- {{baseUrl}}/recipe/review/replies/:replyId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["Comment": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/review/replies/:replyId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Update a given top-level review.
{{baseUrl}}/recipe/review/:reviewId
QUERY PARAMS
reviewId
BODY json
{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/recipe/review/:reviewId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/recipe/review/:reviewId" {:content-type :json
:form-params {:ActiveMinutes 0
:Comment ""
:MakeAgain ""
:StarRating 0
:TotalMinutes 0}})
require "http/client"
url = "{{baseUrl}}/recipe/review/:reviewId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/recipe/review/:reviewId"),
Content = new StringContent("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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}}/recipe/review/:reviewId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/recipe/review/:reviewId"
payload := strings.NewReader("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/recipe/review/:reviewId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 100
{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/recipe/review/:reviewId")
.setHeader("content-type", "application/json")
.setBody("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/recipe/review/:reviewId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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 \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/recipe/review/:reviewId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/recipe/review/:reviewId")
.header("content-type", "application/json")
.body("{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
.asString();
const data = JSON.stringify({
ActiveMinutes: 0,
Comment: '',
MakeAgain: '',
StarRating: 0,
TotalMinutes: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/recipe/review/:reviewId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/review/:reviewId',
headers: {'content-type': 'application/json'},
data: {ActiveMinutes: 0, Comment: '', MakeAgain: '', StarRating: 0, TotalMinutes: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/recipe/review/:reviewId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"Comment":"","MakeAgain":"","StarRating":0,"TotalMinutes":0}'
};
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}}/recipe/review/:reviewId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ActiveMinutes": 0,\n "Comment": "",\n "MakeAgain": "",\n "StarRating": 0,\n "TotalMinutes": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/recipe/review/:reviewId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/recipe/review/:reviewId',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ActiveMinutes: 0, Comment: '', MakeAgain: '', StarRating: 0, TotalMinutes: 0}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/review/:reviewId',
headers: {'content-type': 'application/json'},
body: {ActiveMinutes: 0, Comment: '', MakeAgain: '', StarRating: 0, TotalMinutes: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/recipe/review/:reviewId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ActiveMinutes: 0,
Comment: '',
MakeAgain: '',
StarRating: 0,
TotalMinutes: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/recipe/review/:reviewId',
headers: {'content-type': 'application/json'},
data: {ActiveMinutes: 0, Comment: '', MakeAgain: '', StarRating: 0, TotalMinutes: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/recipe/review/:reviewId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ActiveMinutes":0,"Comment":"","MakeAgain":"","StarRating":0,"TotalMinutes":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ActiveMinutes": @0,
@"Comment": @"",
@"MakeAgain": @"",
@"StarRating": @0,
@"TotalMinutes": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/recipe/review/:reviewId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/recipe/review/:reviewId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/recipe/review/:reviewId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ActiveMinutes' => 0,
'Comment' => '',
'MakeAgain' => '',
'StarRating' => 0,
'TotalMinutes' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/recipe/review/:reviewId', [
'body' => '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/recipe/review/:reviewId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ActiveMinutes' => 0,
'Comment' => '',
'MakeAgain' => '',
'StarRating' => 0,
'TotalMinutes' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ActiveMinutes' => 0,
'Comment' => '',
'MakeAgain' => '',
'StarRating' => 0,
'TotalMinutes' => 0
]));
$request->setRequestUrl('{{baseUrl}}/recipe/review/:reviewId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/recipe/review/:reviewId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/recipe/review/:reviewId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/recipe/review/:reviewId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/recipe/review/:reviewId"
payload = {
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/recipe/review/:reviewId"
payload <- "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/recipe/review/:reviewId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/recipe/review/:reviewId') do |req|
req.body = "{\n \"ActiveMinutes\": 0,\n \"Comment\": \"\",\n \"MakeAgain\": \"\",\n \"StarRating\": 0,\n \"TotalMinutes\": 0\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}}/recipe/review/:reviewId";
let payload = json!({
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/recipe/review/:reviewId \
--header 'content-type: application/json' \
--data '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}'
echo '{
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
}' | \
http PUT {{baseUrl}}/recipe/review/:reviewId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ActiveMinutes": 0,\n "Comment": "",\n "MakeAgain": "",\n "StarRating": 0,\n "TotalMinutes": 0\n}' \
--output-document \
- {{baseUrl}}/recipe/review/:reviewId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ActiveMinutes": 0,
"Comment": "",
"MakeAgain": "",
"StarRating": 0,
"TotalMinutes": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/recipe/review/:reviewId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()