API
PUT
Add article details that associate with a Gym
{{baseUrl}}/api/Article/ArticleGymDetails
BODY json
[
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article/ArticleGymDetails");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/Article/ArticleGymDetails" {:content-type :json
:form-params [{:articleId 0
:availableQty ""
:createdUser ""
:employeeDiscount ""
:employeePrice ""
:gymId 0
:gymIdList ""
:gymName ""
:id 0
:isDefault false
:isInventoryItem false
:isObsolete false
:modifiedUser ""
:reorderLevel ""
:revenueAccountId 0
:sellingPrice ""}]})
require "http/client"
url = "{{baseUrl}}/api/Article/ArticleGymDetails"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\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}}/api/Article/ArticleGymDetails"),
Content = new StringContent("[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\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}}/api/Article/ArticleGymDetails");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article/ArticleGymDetails"
payload := strings.NewReader("[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\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/api/Article/ArticleGymDetails HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 377
[
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/Article/ArticleGymDetails")
.setHeader("content-type", "application/json")
.setBody("[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article/ArticleGymDetails"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n]"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Article/ArticleGymDetails")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/Article/ArticleGymDetails")
.header("content-type", "application/json")
.body("[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n]")
.asString();
const data = JSON.stringify([
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/Article/ArticleGymDetails');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/Article/ArticleGymDetails',
headers: {'content-type': 'application/json'},
data: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article/ArticleGymDetails';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '[{"articleId":0,"availableQty":"","createdUser":"","employeeDiscount":"","employeePrice":"","gymId":0,"gymIdList":"","gymName":"","id":0,"isDefault":false,"isInventoryItem":false,"isObsolete":false,"modifiedUser":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":""}]'
};
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}}/api/Article/ArticleGymDetails',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\n {\n "articleId": 0,\n "availableQty": "",\n "createdUser": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymId": 0,\n "gymIdList": "",\n "gymName": "",\n "id": 0,\n "isDefault": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "modifiedUser": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": ""\n }\n]'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n]")
val request = Request.Builder()
.url("{{baseUrl}}/api/Article/ArticleGymDetails")
.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/api/Article/ArticleGymDetails',
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([
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
]));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/Article/ArticleGymDetails',
headers: {'content-type': 'application/json'},
body: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
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}}/api/Article/ArticleGymDetails');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
]);
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}}/api/Article/ArticleGymDetails',
headers: {'content-type': 'application/json'},
data: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article/ArticleGymDetails';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '[{"articleId":0,"availableQty":"","createdUser":"","employeeDiscount":"","employeePrice":"","gymId":0,"gymIdList":"","gymName":"","id":0,"isDefault":false,"isInventoryItem":false,"isObsolete":false,"modifiedUser":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":""}]'
};
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 = @[ @{ @"articleId": @0, @"availableQty": @"", @"createdUser": @"", @"employeeDiscount": @"", @"employeePrice": @"", @"gymId": @0, @"gymIdList": @"", @"gymName": @"", @"id": @0, @"isDefault": @NO, @"isInventoryItem": @NO, @"isObsolete": @NO, @"modifiedUser": @"", @"reorderLevel": @"", @"revenueAccountId": @0, @"sellingPrice": @"" } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Article/ArticleGymDetails"]
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}}/api/Article/ArticleGymDetails" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n]" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article/ArticleGymDetails",
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([
[
'articleId' => 0,
'availableQty' => '',
'createdUser' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymId' => 0,
'gymIdList' => '',
'gymName' => '',
'id' => 0,
'isDefault' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'modifiedUser' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => ''
]
]),
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}}/api/Article/ArticleGymDetails', [
'body' => '[
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article/ArticleGymDetails');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
'articleId' => 0,
'availableQty' => '',
'createdUser' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymId' => 0,
'gymIdList' => '',
'gymName' => '',
'id' => 0,
'isDefault' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'modifiedUser' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
'articleId' => 0,
'availableQty' => '',
'createdUser' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymId' => 0,
'gymIdList' => '',
'gymName' => '',
'id' => 0,
'isDefault' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'modifiedUser' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/api/Article/ArticleGymDetails');
$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}}/api/Article/ArticleGymDetails' -Method PUT -Headers $headers -ContentType 'application/json' -Body '[
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article/ArticleGymDetails' -Method PUT -Headers $headers -ContentType 'application/json' -Body '[
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n]"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/api/Article/ArticleGymDetails", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article/ArticleGymDetails"
payload = [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": False,
"isInventoryItem": False,
"isObsolete": False,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
]
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article/ArticleGymDetails"
payload <- "[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\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}}/api/Article/ArticleGymDetails")
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 {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\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/api/Article/ArticleGymDetails') do |req|
req.body = "[\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\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}}/api/Article/ArticleGymDetails";
let payload = (
json!({
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
})
);
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}}/api/Article/ArticleGymDetails \
--header 'content-type: application/json' \
--data '[
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
]'
echo '[
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
]' | \
http PUT {{baseUrl}}/api/Article/ArticleGymDetails \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '[\n {\n "articleId": 0,\n "availableQty": "",\n "createdUser": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymId": 0,\n "gymIdList": "",\n "gymName": "",\n "id": 0,\n "isDefault": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "modifiedUser": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": ""\n }\n]' \
--output-document \
- {{baseUrl}}/api/Article/ArticleGymDetails
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
[
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article/ArticleGymDetails")! 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
Add measure unit
{{baseUrl}}/api/Article/MeasureUnit
BODY json
[
{
"id": 0,
"name": "",
"type": ""
}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article/MeasureUnit");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/Article/MeasureUnit" {:content-type :json
:form-params [{:id 0
:name ""
:type ""}]})
require "http/client"
url = "{{baseUrl}}/api/Article/MeasureUnit"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/Article/MeasureUnit"),
Content = new StringContent("[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\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}}/api/Article/MeasureUnit");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article/MeasureUnit"
payload := strings.NewReader("[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/Article/MeasureUnit HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 55
[
{
"id": 0,
"name": "",
"type": ""
}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/Article/MeasureUnit")
.setHeader("content-type", "application/json")
.setBody("[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article/MeasureUnit"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Article/MeasureUnit")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/Article/MeasureUnit")
.header("content-type", "application/json")
.body("[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]")
.asString();
const data = JSON.stringify([
{
id: 0,
name: '',
type: ''
}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/Article/MeasureUnit');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Article/MeasureUnit',
headers: {'content-type': 'application/json'},
data: [{id: 0, name: '', type: ''}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article/MeasureUnit';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"id":0,"name":"","type":""}]'
};
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}}/api/Article/MeasureUnit',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\n {\n "id": 0,\n "name": "",\n "type": ""\n }\n]'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]")
val request = Request.Builder()
.url("{{baseUrl}}/api/Article/MeasureUnit")
.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/api/Article/MeasureUnit',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify([{id: 0, name: '', type: ''}]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Article/MeasureUnit',
headers: {'content-type': 'application/json'},
body: [{id: 0, name: '', type: ''}],
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}}/api/Article/MeasureUnit');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{
id: 0,
name: '',
type: ''
}
]);
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Article/MeasureUnit',
headers: {'content-type': 'application/json'},
data: [{id: 0, name: '', type: ''}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article/MeasureUnit';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"id":0,"name":"","type":""}]'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"id": @0, @"name": @"", @"type": @"" } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Article/MeasureUnit"]
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}}/api/Article/MeasureUnit" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article/MeasureUnit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'id' => 0,
'name' => '',
'type' => ''
]
]),
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}}/api/Article/MeasureUnit', [
'body' => '[
{
"id": 0,
"name": "",
"type": ""
}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article/MeasureUnit');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
'id' => 0,
'name' => '',
'type' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
'id' => 0,
'name' => '',
'type' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/api/Article/MeasureUnit');
$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}}/api/Article/MeasureUnit' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"id": 0,
"name": "",
"type": ""
}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article/MeasureUnit' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"id": 0,
"name": "",
"type": ""
}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/api/Article/MeasureUnit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article/MeasureUnit"
payload = [
{
"id": 0,
"name": "",
"type": ""
}
]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article/MeasureUnit"
payload <- "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Article/MeasureUnit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/Article/MeasureUnit') do |req|
req.body = "[\n {\n \"id\": 0,\n \"name\": \"\",\n \"type\": \"\"\n }\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article/MeasureUnit";
let payload = (
json!({
"id": 0,
"name": "",
"type": ""
})
);
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}}/api/Article/MeasureUnit \
--header 'content-type: application/json' \
--data '[
{
"id": 0,
"name": "",
"type": ""
}
]'
echo '[
{
"id": 0,
"name": "",
"type": ""
}
]' | \
http POST {{baseUrl}}/api/Article/MeasureUnit \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {\n "id": 0,\n "name": "",\n "type": ""\n }\n]' \
--output-document \
- {{baseUrl}}/api/Article/MeasureUnit
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
[
"id": 0,
"name": "",
"type": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article/MeasureUnit")! 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 new article
{{baseUrl}}/api/Article
BODY json
{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article");
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 \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/Article" {:content-type :json
:form-params {:activeStatus false
:applyForAllGyms false
:articleId 0
:availableGyms [{:externalGymNumber 0
:gymId 0
:gymName ""
:location ""}]
:availableQty ""
:barcode ""
:createdDate ""
:createdUser ""
:cronExpression ""
:description ""
:discount ""
:employeeDiscount ""
:employeePrice ""
:gymArticles [{:articleId 0
:availableQty ""
:createdUser ""
:employeeDiscount ""
:employeePrice ""
:gymId 0
:gymIdList ""
:gymName ""
:id 0
:isDefault false
:isInventoryItem false
:isObsolete false
:modifiedUser ""
:reorderLevel ""
:revenueAccountId 0
:sellingPrice ""}]
:isAddOn false
:isInventoryItem false
:isObsolete false
:measureUnit ""
:modifiedDate ""
:modifiedUser ""
:name ""
:number 0
:price ""
:reorderLevel ""
:revenueAccountId 0
:sellingPrice ""
:tags ""
:type ""
:vat ""
:vatApplicable false}})
require "http/client"
url = "{{baseUrl}}/api/Article"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/Article"),
Content = new StringContent("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article"
payload := strings.NewReader("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/Article HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1144
{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/Article")
.setHeader("content-type", "application/json")
.setBody("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Article")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/Article")
.header("content-type", "application/json")
.body("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}")
.asString();
const data = JSON.stringify({
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [
{
externalGymNumber: 0,
gymId: 0,
gymName: '',
location: ''
}
],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/Article');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Article',
headers: {'content-type': 'application/json'},
data: {
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"activeStatus":false,"applyForAllGyms":false,"articleId":0,"availableGyms":[{"externalGymNumber":0,"gymId":0,"gymName":"","location":""}],"availableQty":"","barcode":"","createdDate":"","createdUser":"","cronExpression":"","description":"","discount":"","employeeDiscount":"","employeePrice":"","gymArticles":[{"articleId":0,"availableQty":"","createdUser":"","employeeDiscount":"","employeePrice":"","gymId":0,"gymIdList":"","gymName":"","id":0,"isDefault":false,"isInventoryItem":false,"isObsolete":false,"modifiedUser":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":""}],"isAddOn":false,"isInventoryItem":false,"isObsolete":false,"measureUnit":"","modifiedDate":"","modifiedUser":"","name":"","number":0,"price":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":"","tags":"","type":"","vat":"","vatApplicable":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/Article',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "activeStatus": false,\n "applyForAllGyms": false,\n "articleId": 0,\n "availableGyms": [\n {\n "externalGymNumber": 0,\n "gymId": 0,\n "gymName": "",\n "location": ""\n }\n ],\n "availableQty": "",\n "barcode": "",\n "createdDate": "",\n "createdUser": "",\n "cronExpression": "",\n "description": "",\n "discount": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymArticles": [\n {\n "articleId": 0,\n "availableQty": "",\n "createdUser": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymId": 0,\n "gymIdList": "",\n "gymName": "",\n "id": 0,\n "isDefault": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "modifiedUser": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": ""\n }\n ],\n "isAddOn": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "measureUnit": "",\n "modifiedDate": "",\n "modifiedUser": "",\n "name": "",\n "number": 0,\n "price": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": "",\n "tags": "",\n "type": "",\n "vat": "",\n "vatApplicable": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/Article")
.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/api/Article',
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({
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Article',
headers: {'content-type': 'application/json'},
body: {
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/Article');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [
{
externalGymNumber: 0,
gymId: 0,
gymName: '',
location: ''
}
],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Article',
headers: {'content-type': 'application/json'},
data: {
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"activeStatus":false,"applyForAllGyms":false,"articleId":0,"availableGyms":[{"externalGymNumber":0,"gymId":0,"gymName":"","location":""}],"availableQty":"","barcode":"","createdDate":"","createdUser":"","cronExpression":"","description":"","discount":"","employeeDiscount":"","employeePrice":"","gymArticles":[{"articleId":0,"availableQty":"","createdUser":"","employeeDiscount":"","employeePrice":"","gymId":0,"gymIdList":"","gymName":"","id":0,"isDefault":false,"isInventoryItem":false,"isObsolete":false,"modifiedUser":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":""}],"isAddOn":false,"isInventoryItem":false,"isObsolete":false,"measureUnit":"","modifiedDate":"","modifiedUser":"","name":"","number":0,"price":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":"","tags":"","type":"","vat":"","vatApplicable":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"activeStatus": @NO,
@"applyForAllGyms": @NO,
@"articleId": @0,
@"availableGyms": @[ @{ @"externalGymNumber": @0, @"gymId": @0, @"gymName": @"", @"location": @"" } ],
@"availableQty": @"",
@"barcode": @"",
@"createdDate": @"",
@"createdUser": @"",
@"cronExpression": @"",
@"description": @"",
@"discount": @"",
@"employeeDiscount": @"",
@"employeePrice": @"",
@"gymArticles": @[ @{ @"articleId": @0, @"availableQty": @"", @"createdUser": @"", @"employeeDiscount": @"", @"employeePrice": @"", @"gymId": @0, @"gymIdList": @"", @"gymName": @"", @"id": @0, @"isDefault": @NO, @"isInventoryItem": @NO, @"isObsolete": @NO, @"modifiedUser": @"", @"reorderLevel": @"", @"revenueAccountId": @0, @"sellingPrice": @"" } ],
@"isAddOn": @NO,
@"isInventoryItem": @NO,
@"isObsolete": @NO,
@"measureUnit": @"",
@"modifiedDate": @"",
@"modifiedUser": @"",
@"name": @"",
@"number": @0,
@"price": @"",
@"reorderLevel": @"",
@"revenueAccountId": @0,
@"sellingPrice": @"",
@"tags": @"",
@"type": @"",
@"vat": @"",
@"vatApplicable": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Article"]
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}}/api/Article" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article",
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([
'activeStatus' => null,
'applyForAllGyms' => null,
'articleId' => 0,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'availableQty' => '',
'barcode' => '',
'createdDate' => '',
'createdUser' => '',
'cronExpression' => '',
'description' => '',
'discount' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymArticles' => [
[
'articleId' => 0,
'availableQty' => '',
'createdUser' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymId' => 0,
'gymIdList' => '',
'gymName' => '',
'id' => 0,
'isDefault' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'modifiedUser' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => ''
]
],
'isAddOn' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'measureUnit' => '',
'modifiedDate' => '',
'modifiedUser' => '',
'name' => '',
'number' => 0,
'price' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => '',
'tags' => '',
'type' => '',
'vat' => '',
'vatApplicable' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/Article', [
'body' => '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'activeStatus' => null,
'applyForAllGyms' => null,
'articleId' => 0,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'availableQty' => '',
'barcode' => '',
'createdDate' => '',
'createdUser' => '',
'cronExpression' => '',
'description' => '',
'discount' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymArticles' => [
[
'articleId' => 0,
'availableQty' => '',
'createdUser' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymId' => 0,
'gymIdList' => '',
'gymName' => '',
'id' => 0,
'isDefault' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'modifiedUser' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => ''
]
],
'isAddOn' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'measureUnit' => '',
'modifiedDate' => '',
'modifiedUser' => '',
'name' => '',
'number' => 0,
'price' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => '',
'tags' => '',
'type' => '',
'vat' => '',
'vatApplicable' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'activeStatus' => null,
'applyForAllGyms' => null,
'articleId' => 0,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'availableQty' => '',
'barcode' => '',
'createdDate' => '',
'createdUser' => '',
'cronExpression' => '',
'description' => '',
'discount' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymArticles' => [
[
'articleId' => 0,
'availableQty' => '',
'createdUser' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymId' => 0,
'gymIdList' => '',
'gymName' => '',
'id' => 0,
'isDefault' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'modifiedUser' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => ''
]
],
'isAddOn' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'measureUnit' => '',
'modifiedDate' => '',
'modifiedUser' => '',
'name' => '',
'number' => 0,
'price' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => '',
'tags' => '',
'type' => '',
'vat' => '',
'vatApplicable' => null
]));
$request->setRequestUrl('{{baseUrl}}/api/Article');
$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}}/api/Article' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/api/Article", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article"
payload = {
"activeStatus": False,
"applyForAllGyms": False,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": False,
"isInventoryItem": False,
"isObsolete": False,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": False,
"isInventoryItem": False,
"isObsolete": False,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article"
payload <- "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\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}}/api/Article")
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 \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/Article') do |req|
req.body = "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article";
let payload = json!({
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": (
json!({
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
})
),
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": (
json!({
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
})
),
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/Article \
--header 'content-type: application/json' \
--data '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}'
echo '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}' | \
http POST {{baseUrl}}/api/Article \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "activeStatus": false,\n "applyForAllGyms": false,\n "articleId": 0,\n "availableGyms": [\n {\n "externalGymNumber": 0,\n "gymId": 0,\n "gymName": "",\n "location": ""\n }\n ],\n "availableQty": "",\n "barcode": "",\n "createdDate": "",\n "createdUser": "",\n "cronExpression": "",\n "description": "",\n "discount": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymArticles": [\n {\n "articleId": 0,\n "availableQty": "",\n "createdUser": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymId": 0,\n "gymIdList": "",\n "gymName": "",\n "id": 0,\n "isDefault": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "modifiedUser": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": ""\n }\n ],\n "isAddOn": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "measureUnit": "",\n "modifiedDate": "",\n "modifiedUser": "",\n "name": "",\n "number": 0,\n "price": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": "",\n "tags": "",\n "type": "",\n "vat": "",\n "vatApplicable": false\n}' \
--output-document \
- {{baseUrl}}/api/Article
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
[
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
]
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
[
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
]
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article")! 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
Article_GetAddons
{{baseUrl}}/api/Article/GetAddons
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article/GetAddons");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Article/GetAddons")
require "http/client"
url = "{{baseUrl}}/api/Article/GetAddons"
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}}/api/Article/GetAddons"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article/GetAddons");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article/GetAddons"
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/api/Article/GetAddons HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Article/GetAddons")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article/GetAddons"))
.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}}/api/Article/GetAddons")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Article/GetAddons")
.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}}/api/Article/GetAddons');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Article/GetAddons'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article/GetAddons';
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}}/api/Article/GetAddons',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Article/GetAddons")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Article/GetAddons',
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}}/api/Article/GetAddons'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Article/GetAddons');
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}}/api/Article/GetAddons'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article/GetAddons';
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}}/api/Article/GetAddons"]
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}}/api/Article/GetAddons" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article/GetAddons",
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}}/api/Article/GetAddons');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article/GetAddons');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Article/GetAddons');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Article/GetAddons' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article/GetAddons' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Article/GetAddons")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article/GetAddons"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article/GetAddons"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Article/GetAddons")
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/api/Article/GetAddons') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article/GetAddons";
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}}/api/Article/GetAddons
http GET {{baseUrl}}/api/Article/GetAddons
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Article/GetAddons
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article/GetAddons")! 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
Deactivate existing article
{{baseUrl}}/api/Article/UpdateStatus
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article/UpdateStatus");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/Article/UpdateStatus")
require "http/client"
url = "{{baseUrl}}/api/Article/UpdateStatus"
response = HTTP::Client.put url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/api/Article/UpdateStatus"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article/UpdateStatus");
var request = new RestRequest("", Method.Put);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article/UpdateStatus"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/api/Article/UpdateStatus HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/Article/UpdateStatus")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article/UpdateStatus"))
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Article/UpdateStatus")
.put(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/Article/UpdateStatus")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/Article/UpdateStatus');
xhr.send(data);
import axios from 'axios';
const options = {method: 'PUT', url: '{{baseUrl}}/api/Article/UpdateStatus'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article/UpdateStatus';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/Article/UpdateStatus',
method: 'PUT',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Article/UpdateStatus")
.put(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Article/UpdateStatus',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'PUT', url: '{{baseUrl}}/api/Article/UpdateStatus'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/Article/UpdateStatus');
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}}/api/Article/UpdateStatus'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article/UpdateStatus';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Article/UpdateStatus"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/Article/UpdateStatus" in
Client.call `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article/UpdateStatus",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/Article/UpdateStatus');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article/UpdateStatus');
$request->setMethod(HTTP_METH_PUT);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Article/UpdateStatus');
$request->setRequestMethod('PUT');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Article/UpdateStatus' -Method PUT
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article/UpdateStatus' -Method PUT
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("PUT", "/baseUrl/api/Article/UpdateStatus")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article/UpdateStatus"
response = requests.put(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article/UpdateStatus"
response <- VERB("PUT", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Article/UpdateStatus")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/api/Article/UpdateStatus') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article/UpdateStatus";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/api/Article/UpdateStatus
http PUT {{baseUrl}}/api/Article/UpdateStatus
wget --quiet \
--method PUT \
--output-document \
- {{baseUrl}}/api/Article/UpdateStatus
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article/UpdateStatus")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete article from the system
{{baseUrl}}/api/Article
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/api/Article")
require "http/client"
url = "{{baseUrl}}/api/Article"
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}}/api/Article"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article"
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/api/Article HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/api/Article")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article"))
.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}}/api/Article")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/api/Article")
.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}}/api/Article');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/api/Article'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article';
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}}/api/Article',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Article")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Article',
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}}/api/Article'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/api/Article');
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}}/api/Article'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article';
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}}/api/Article"]
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}}/api/Article" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article",
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}}/api/Article');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Article');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Article' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/api/Article")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Article")
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/api/Article') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article";
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}}/api/Article
http DELETE {{baseUrl}}/api/Article
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/api/Article
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article")! 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 Gym specific properties for article
{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId
QUERY PARAMS
articleId
gymId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId")
require "http/client"
url = "{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId"
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}}/api/Article/GymArticle/:articleId/:gymId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId"
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/api/Article/GymArticle/:articleId/:gymId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId"))
.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}}/api/Article/GymArticle/:articleId/:gymId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId")
.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}}/api/Article/GymArticle/:articleId/:gymId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId';
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}}/api/Article/GymArticle/:articleId/:gymId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Article/GymArticle/:articleId/:gymId',
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}}/api/Article/GymArticle/:articleId/:gymId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId');
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}}/api/Article/GymArticle/:articleId/:gymId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId';
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}}/api/Article/GymArticle/:articleId/:gymId"]
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}}/api/Article/GymArticle/:articleId/:gymId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId",
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}}/api/Article/GymArticle/:articleId/:gymId');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Article/GymArticle/:articleId/:gymId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId")
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/api/Article/GymArticle/:articleId/:gymId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId";
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}}/api/Article/GymArticle/:articleId/:gymId
http GET {{baseUrl}}/api/Article/GymArticle/:articleId/:gymId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Article/GymArticle/:articleId/:gymId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article/GymArticle/:articleId/:gymId")! 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 Revenue Accounts
{{baseUrl}}/api/Article/RevenueAccounts
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article/RevenueAccounts");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Article/RevenueAccounts")
require "http/client"
url = "{{baseUrl}}/api/Article/RevenueAccounts"
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}}/api/Article/RevenueAccounts"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article/RevenueAccounts");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article/RevenueAccounts"
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/api/Article/RevenueAccounts HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Article/RevenueAccounts")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article/RevenueAccounts"))
.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}}/api/Article/RevenueAccounts")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Article/RevenueAccounts")
.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}}/api/Article/RevenueAccounts');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Article/RevenueAccounts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article/RevenueAccounts';
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}}/api/Article/RevenueAccounts',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Article/RevenueAccounts")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Article/RevenueAccounts',
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}}/api/Article/RevenueAccounts'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Article/RevenueAccounts');
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}}/api/Article/RevenueAccounts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article/RevenueAccounts';
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}}/api/Article/RevenueAccounts"]
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}}/api/Article/RevenueAccounts" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article/RevenueAccounts",
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}}/api/Article/RevenueAccounts');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article/RevenueAccounts');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Article/RevenueAccounts');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Article/RevenueAccounts' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article/RevenueAccounts' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Article/RevenueAccounts")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article/RevenueAccounts"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article/RevenueAccounts"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Article/RevenueAccounts")
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/api/Article/RevenueAccounts') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article/RevenueAccounts";
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}}/api/Article/RevenueAccounts
http GET {{baseUrl}}/api/Article/RevenueAccounts
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Article/RevenueAccounts
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article/RevenueAccounts")! 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}}/api/Article/:articleID");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Article/:articleID")
require "http/client"
url = "{{baseUrl}}/api/Article/:articleID"
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}}/api/Article/:articleID"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article/:articleID");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article/:articleID"
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/api/Article/:articleID HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Article/:articleID")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article/:articleID"))
.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}}/api/Article/:articleID")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Article/:articleID")
.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}}/api/Article/:articleID');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Article/:articleID'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article/:articleID';
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}}/api/Article/:articleID',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Article/:articleID")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Article/:articleID',
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}}/api/Article/:articleID'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Article/:articleID');
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}}/api/Article/:articleID'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article/:articleID';
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}}/api/Article/:articleID"]
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}}/api/Article/:articleID" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article/:articleID",
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}}/api/Article/:articleID');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article/:articleID');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Article/:articleID');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Article/:articleID' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article/:articleID' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Article/:articleID")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article/:articleID"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article/:articleID"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Article/:articleID")
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/api/Article/:articleID') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article/:articleID";
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}}/api/Article/:articleID
http GET {{baseUrl}}/api/Article/:articleID
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Article/:articleID
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article/:articleID")! 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 mesure units
{{baseUrl}}/api/Article/MeasureUnits
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article/MeasureUnits");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Article/MeasureUnits")
require "http/client"
url = "{{baseUrl}}/api/Article/MeasureUnits"
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}}/api/Article/MeasureUnits"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article/MeasureUnits");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article/MeasureUnits"
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/api/Article/MeasureUnits HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Article/MeasureUnits")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article/MeasureUnits"))
.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}}/api/Article/MeasureUnits")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Article/MeasureUnits")
.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}}/api/Article/MeasureUnits');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Article/MeasureUnits'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article/MeasureUnits';
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}}/api/Article/MeasureUnits',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Article/MeasureUnits")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Article/MeasureUnits',
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}}/api/Article/MeasureUnits'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Article/MeasureUnits');
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}}/api/Article/MeasureUnits'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article/MeasureUnits';
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}}/api/Article/MeasureUnits"]
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}}/api/Article/MeasureUnits" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article/MeasureUnits",
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}}/api/Article/MeasureUnits');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article/MeasureUnits');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Article/MeasureUnits');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Article/MeasureUnits' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article/MeasureUnits' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Article/MeasureUnits")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article/MeasureUnits"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article/MeasureUnits"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Article/MeasureUnits")
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/api/Article/MeasureUnits') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article/MeasureUnits";
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}}/api/Article/MeasureUnits
http GET {{baseUrl}}/api/Article/MeasureUnits
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Article/MeasureUnits
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article/MeasureUnits")! 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
Search articles It will only return basic information of article
{{baseUrl}}/api/Article/Search
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article/Search");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Article/Search")
require "http/client"
url = "{{baseUrl}}/api/Article/Search"
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}}/api/Article/Search"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article/Search");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article/Search"
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/api/Article/Search HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Article/Search")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article/Search"))
.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}}/api/Article/Search")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Article/Search")
.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}}/api/Article/Search');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Article/Search'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article/Search';
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}}/api/Article/Search',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Article/Search")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Article/Search',
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}}/api/Article/Search'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Article/Search');
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}}/api/Article/Search'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article/Search';
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}}/api/Article/Search"]
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}}/api/Article/Search" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article/Search",
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}}/api/Article/Search');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article/Search');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Article/Search');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Article/Search' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article/Search' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Article/Search")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article/Search"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article/Search"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Article/Search")
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/api/Article/Search') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article/Search";
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}}/api/Article/Search
http GET {{baseUrl}}/api/Article/Search
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Article/Search
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article/Search")! 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
update existing article
{{baseUrl}}/api/Article
BODY json
{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Article");
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 \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/Article" {:content-type :json
:form-params {:activeStatus false
:applyForAllGyms false
:articleId 0
:availableGyms [{:externalGymNumber 0
:gymId 0
:gymName ""
:location ""}]
:availableQty ""
:barcode ""
:createdDate ""
:createdUser ""
:cronExpression ""
:description ""
:discount ""
:employeeDiscount ""
:employeePrice ""
:gymArticles [{:articleId 0
:availableQty ""
:createdUser ""
:employeeDiscount ""
:employeePrice ""
:gymId 0
:gymIdList ""
:gymName ""
:id 0
:isDefault false
:isInventoryItem false
:isObsolete false
:modifiedUser ""
:reorderLevel ""
:revenueAccountId 0
:sellingPrice ""}]
:isAddOn false
:isInventoryItem false
:isObsolete false
:measureUnit ""
:modifiedDate ""
:modifiedUser ""
:name ""
:number 0
:price ""
:reorderLevel ""
:revenueAccountId 0
:sellingPrice ""
:tags ""
:type ""
:vat ""
:vatApplicable false}})
require "http/client"
url = "{{baseUrl}}/api/Article"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\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}}/api/Article"),
Content = new StringContent("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Article");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Article"
payload := strings.NewReader("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\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/api/Article HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1144
{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/Article")
.setHeader("content-type", "application/json")
.setBody("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Article"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Article")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/Article")
.header("content-type", "application/json")
.body("{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}")
.asString();
const data = JSON.stringify({
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [
{
externalGymNumber: 0,
gymId: 0,
gymName: '',
location: ''
}
],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/Article');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/Article',
headers: {'content-type': 'application/json'},
data: {
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Article';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"activeStatus":false,"applyForAllGyms":false,"articleId":0,"availableGyms":[{"externalGymNumber":0,"gymId":0,"gymName":"","location":""}],"availableQty":"","barcode":"","createdDate":"","createdUser":"","cronExpression":"","description":"","discount":"","employeeDiscount":"","employeePrice":"","gymArticles":[{"articleId":0,"availableQty":"","createdUser":"","employeeDiscount":"","employeePrice":"","gymId":0,"gymIdList":"","gymName":"","id":0,"isDefault":false,"isInventoryItem":false,"isObsolete":false,"modifiedUser":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":""}],"isAddOn":false,"isInventoryItem":false,"isObsolete":false,"measureUnit":"","modifiedDate":"","modifiedUser":"","name":"","number":0,"price":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":"","tags":"","type":"","vat":"","vatApplicable":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/Article',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "activeStatus": false,\n "applyForAllGyms": false,\n "articleId": 0,\n "availableGyms": [\n {\n "externalGymNumber": 0,\n "gymId": 0,\n "gymName": "",\n "location": ""\n }\n ],\n "availableQty": "",\n "barcode": "",\n "createdDate": "",\n "createdUser": "",\n "cronExpression": "",\n "description": "",\n "discount": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymArticles": [\n {\n "articleId": 0,\n "availableQty": "",\n "createdUser": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymId": 0,\n "gymIdList": "",\n "gymName": "",\n "id": 0,\n "isDefault": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "modifiedUser": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": ""\n }\n ],\n "isAddOn": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "measureUnit": "",\n "modifiedDate": "",\n "modifiedUser": "",\n "name": "",\n "number": 0,\n "price": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": "",\n "tags": "",\n "type": "",\n "vat": "",\n "vatApplicable": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/Article")
.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/api/Article',
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({
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/Article',
headers: {'content-type': 'application/json'},
body: {
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/Article');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [
{
externalGymNumber: 0,
gymId: 0,
gymName: '',
location: ''
}
],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/Article',
headers: {'content-type': 'application/json'},
data: {
activeStatus: false,
applyForAllGyms: false,
articleId: 0,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
availableQty: '',
barcode: '',
createdDate: '',
createdUser: '',
cronExpression: '',
description: '',
discount: '',
employeeDiscount: '',
employeePrice: '',
gymArticles: [
{
articleId: 0,
availableQty: '',
createdUser: '',
employeeDiscount: '',
employeePrice: '',
gymId: 0,
gymIdList: '',
gymName: '',
id: 0,
isDefault: false,
isInventoryItem: false,
isObsolete: false,
modifiedUser: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: ''
}
],
isAddOn: false,
isInventoryItem: false,
isObsolete: false,
measureUnit: '',
modifiedDate: '',
modifiedUser: '',
name: '',
number: 0,
price: '',
reorderLevel: '',
revenueAccountId: 0,
sellingPrice: '',
tags: '',
type: '',
vat: '',
vatApplicable: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Article';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"activeStatus":false,"applyForAllGyms":false,"articleId":0,"availableGyms":[{"externalGymNumber":0,"gymId":0,"gymName":"","location":""}],"availableQty":"","barcode":"","createdDate":"","createdUser":"","cronExpression":"","description":"","discount":"","employeeDiscount":"","employeePrice":"","gymArticles":[{"articleId":0,"availableQty":"","createdUser":"","employeeDiscount":"","employeePrice":"","gymId":0,"gymIdList":"","gymName":"","id":0,"isDefault":false,"isInventoryItem":false,"isObsolete":false,"modifiedUser":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":""}],"isAddOn":false,"isInventoryItem":false,"isObsolete":false,"measureUnit":"","modifiedDate":"","modifiedUser":"","name":"","number":0,"price":"","reorderLevel":"","revenueAccountId":0,"sellingPrice":"","tags":"","type":"","vat":"","vatApplicable":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"activeStatus": @NO,
@"applyForAllGyms": @NO,
@"articleId": @0,
@"availableGyms": @[ @{ @"externalGymNumber": @0, @"gymId": @0, @"gymName": @"", @"location": @"" } ],
@"availableQty": @"",
@"barcode": @"",
@"createdDate": @"",
@"createdUser": @"",
@"cronExpression": @"",
@"description": @"",
@"discount": @"",
@"employeeDiscount": @"",
@"employeePrice": @"",
@"gymArticles": @[ @{ @"articleId": @0, @"availableQty": @"", @"createdUser": @"", @"employeeDiscount": @"", @"employeePrice": @"", @"gymId": @0, @"gymIdList": @"", @"gymName": @"", @"id": @0, @"isDefault": @NO, @"isInventoryItem": @NO, @"isObsolete": @NO, @"modifiedUser": @"", @"reorderLevel": @"", @"revenueAccountId": @0, @"sellingPrice": @"" } ],
@"isAddOn": @NO,
@"isInventoryItem": @NO,
@"isObsolete": @NO,
@"measureUnit": @"",
@"modifiedDate": @"",
@"modifiedUser": @"",
@"name": @"",
@"number": @0,
@"price": @"",
@"reorderLevel": @"",
@"revenueAccountId": @0,
@"sellingPrice": @"",
@"tags": @"",
@"type": @"",
@"vat": @"",
@"vatApplicable": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Article"]
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}}/api/Article" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Article",
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([
'activeStatus' => null,
'applyForAllGyms' => null,
'articleId' => 0,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'availableQty' => '',
'barcode' => '',
'createdDate' => '',
'createdUser' => '',
'cronExpression' => '',
'description' => '',
'discount' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymArticles' => [
[
'articleId' => 0,
'availableQty' => '',
'createdUser' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymId' => 0,
'gymIdList' => '',
'gymName' => '',
'id' => 0,
'isDefault' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'modifiedUser' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => ''
]
],
'isAddOn' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'measureUnit' => '',
'modifiedDate' => '',
'modifiedUser' => '',
'name' => '',
'number' => 0,
'price' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => '',
'tags' => '',
'type' => '',
'vat' => '',
'vatApplicable' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/Article', [
'body' => '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/Article');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'activeStatus' => null,
'applyForAllGyms' => null,
'articleId' => 0,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'availableQty' => '',
'barcode' => '',
'createdDate' => '',
'createdUser' => '',
'cronExpression' => '',
'description' => '',
'discount' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymArticles' => [
[
'articleId' => 0,
'availableQty' => '',
'createdUser' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymId' => 0,
'gymIdList' => '',
'gymName' => '',
'id' => 0,
'isDefault' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'modifiedUser' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => ''
]
],
'isAddOn' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'measureUnit' => '',
'modifiedDate' => '',
'modifiedUser' => '',
'name' => '',
'number' => 0,
'price' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => '',
'tags' => '',
'type' => '',
'vat' => '',
'vatApplicable' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'activeStatus' => null,
'applyForAllGyms' => null,
'articleId' => 0,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'availableQty' => '',
'barcode' => '',
'createdDate' => '',
'createdUser' => '',
'cronExpression' => '',
'description' => '',
'discount' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymArticles' => [
[
'articleId' => 0,
'availableQty' => '',
'createdUser' => '',
'employeeDiscount' => '',
'employeePrice' => '',
'gymId' => 0,
'gymIdList' => '',
'gymName' => '',
'id' => 0,
'isDefault' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'modifiedUser' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => ''
]
],
'isAddOn' => null,
'isInventoryItem' => null,
'isObsolete' => null,
'measureUnit' => '',
'modifiedDate' => '',
'modifiedUser' => '',
'name' => '',
'number' => 0,
'price' => '',
'reorderLevel' => '',
'revenueAccountId' => 0,
'sellingPrice' => '',
'tags' => '',
'type' => '',
'vat' => '',
'vatApplicable' => null
]));
$request->setRequestUrl('{{baseUrl}}/api/Article');
$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}}/api/Article' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Article' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/api/Article", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Article"
payload = {
"activeStatus": False,
"applyForAllGyms": False,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": False,
"isInventoryItem": False,
"isObsolete": False,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": False,
"isInventoryItem": False,
"isObsolete": False,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Article"
payload <- "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\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}}/api/Article")
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 \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/api/Article') do |req|
req.body = "{\n \"activeStatus\": false,\n \"applyForAllGyms\": false,\n \"articleId\": 0,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"availableQty\": \"\",\n \"barcode\": \"\",\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"cronExpression\": \"\",\n \"description\": \"\",\n \"discount\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymArticles\": [\n {\n \"articleId\": 0,\n \"availableQty\": \"\",\n \"createdUser\": \"\",\n \"employeeDiscount\": \"\",\n \"employeePrice\": \"\",\n \"gymId\": 0,\n \"gymIdList\": \"\",\n \"gymName\": \"\",\n \"id\": 0,\n \"isDefault\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"modifiedUser\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\"\n }\n ],\n \"isAddOn\": false,\n \"isInventoryItem\": false,\n \"isObsolete\": false,\n \"measureUnit\": \"\",\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"name\": \"\",\n \"number\": 0,\n \"price\": \"\",\n \"reorderLevel\": \"\",\n \"revenueAccountId\": 0,\n \"sellingPrice\": \"\",\n \"tags\": \"\",\n \"type\": \"\",\n \"vat\": \"\",\n \"vatApplicable\": false\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Article";
let payload = json!({
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": (
json!({
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
})
),
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": (
json!({
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
})
),
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
});
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}}/api/Article \
--header 'content-type: application/json' \
--data '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}'
echo '{
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
{
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
}
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
}' | \
http PUT {{baseUrl}}/api/Article \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "activeStatus": false,\n "applyForAllGyms": false,\n "articleId": 0,\n "availableGyms": [\n {\n "externalGymNumber": 0,\n "gymId": 0,\n "gymName": "",\n "location": ""\n }\n ],\n "availableQty": "",\n "barcode": "",\n "createdDate": "",\n "createdUser": "",\n "cronExpression": "",\n "description": "",\n "discount": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymArticles": [\n {\n "articleId": 0,\n "availableQty": "",\n "createdUser": "",\n "employeeDiscount": "",\n "employeePrice": "",\n "gymId": 0,\n "gymIdList": "",\n "gymName": "",\n "id": 0,\n "isDefault": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "modifiedUser": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": ""\n }\n ],\n "isAddOn": false,\n "isInventoryItem": false,\n "isObsolete": false,\n "measureUnit": "",\n "modifiedDate": "",\n "modifiedUser": "",\n "name": "",\n "number": 0,\n "price": "",\n "reorderLevel": "",\n "revenueAccountId": 0,\n "sellingPrice": "",\n "tags": "",\n "type": "",\n "vat": "",\n "vatApplicable": false\n}' \
--output-document \
- {{baseUrl}}/api/Article
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"activeStatus": false,
"applyForAllGyms": false,
"articleId": 0,
"availableGyms": [
[
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
]
],
"availableQty": "",
"barcode": "",
"createdDate": "",
"createdUser": "",
"cronExpression": "",
"description": "",
"discount": "",
"employeeDiscount": "",
"employeePrice": "",
"gymArticles": [
[
"articleId": 0,
"availableQty": "",
"createdUser": "",
"employeeDiscount": "",
"employeePrice": "",
"gymId": 0,
"gymIdList": "",
"gymName": "",
"id": 0,
"isDefault": false,
"isInventoryItem": false,
"isObsolete": false,
"modifiedUser": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": ""
]
],
"isAddOn": false,
"isInventoryItem": false,
"isObsolete": false,
"measureUnit": "",
"modifiedDate": "",
"modifiedUser": "",
"name": "",
"number": 0,
"price": "",
"reorderLevel": "",
"revenueAccountId": 0,
"sellingPrice": "",
"tags": "",
"type": "",
"vat": "",
"vatApplicable": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Article")! 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
Authenticate and provide token for autherizations.
{{baseUrl}}/api/Auth/login
BODY json
{
"password": "",
"remember": false,
"username": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Auth/login");
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 \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/Auth/login" {:content-type :json
:form-params {:password ""
:remember false
:username ""}})
require "http/client"
url = "{{baseUrl}}/api/Auth/login"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\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}}/api/Auth/login"),
Content = new StringContent("{\n \"password\": \"\",\n \"remember\": false,\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}}/api/Auth/login");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Auth/login"
payload := strings.NewReader("{\n \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\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/api/Auth/login HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 59
{
"password": "",
"remember": false,
"username": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/Auth/login")
.setHeader("content-type", "application/json")
.setBody("{\n \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Auth/login"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"password\": \"\",\n \"remember\": false,\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 \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Auth/login")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/Auth/login")
.header("content-type", "application/json")
.body("{\n \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\n}")
.asString();
const data = JSON.stringify({
password: '',
remember: false,
username: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/Auth/login');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Auth/login',
headers: {'content-type': 'application/json'},
data: {password: '', remember: false, username: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Auth/login';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"password":"","remember":false,"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}}/api/Auth/login',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "password": "",\n "remember": false,\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 \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/Auth/login")
.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/api/Auth/login',
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({password: '', remember: false, username: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Auth/login',
headers: {'content-type': 'application/json'},
body: {password: '', remember: false, 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('POST', '{{baseUrl}}/api/Auth/login');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
password: '',
remember: false,
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: 'POST',
url: '{{baseUrl}}/api/Auth/login',
headers: {'content-type': 'application/json'},
data: {password: '', remember: false, username: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Auth/login';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"password":"","remember":false,"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 = @{ @"password": @"",
@"remember": @NO,
@"username": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Auth/login"]
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}}/api/Auth/login" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Auth/login",
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([
'password' => '',
'remember' => null,
'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('POST', '{{baseUrl}}/api/Auth/login', [
'body' => '{
"password": "",
"remember": false,
"username": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/Auth/login');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'password' => '',
'remember' => null,
'username' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'password' => '',
'remember' => null,
'username' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/Auth/login');
$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}}/api/Auth/login' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"password": "",
"remember": false,
"username": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Auth/login' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"password": "",
"remember": false,
"username": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/api/Auth/login", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Auth/login"
payload = {
"password": "",
"remember": False,
"username": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Auth/login"
payload <- "{\n \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\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}}/api/Auth/login")
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 \"password\": \"\",\n \"remember\": false,\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.post('/baseUrl/api/Auth/login') do |req|
req.body = "{\n \"password\": \"\",\n \"remember\": false,\n \"username\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Auth/login";
let payload = json!({
"password": "",
"remember": false,
"username": ""
});
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}}/api/Auth/login \
--header 'content-type: application/json' \
--data '{
"password": "",
"remember": false,
"username": ""
}'
echo '{
"password": "",
"remember": false,
"username": ""
}' | \
http POST {{baseUrl}}/api/Auth/login \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "password": "",\n "remember": false,\n "username": ""\n}' \
--output-document \
- {{baseUrl}}/api/Auth/login
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"password": "",
"remember": false,
"username": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Auth/login")! 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()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Gym/:gymID");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Gym/:gymID")
require "http/client"
url = "{{baseUrl}}/api/Gym/:gymID"
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}}/api/Gym/:gymID"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Gym/:gymID");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Gym/:gymID"
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/api/Gym/:gymID HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Gym/:gymID")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Gym/:gymID"))
.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}}/api/Gym/:gymID")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Gym/:gymID")
.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}}/api/Gym/:gymID');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Gym/:gymID'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Gym/:gymID';
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}}/api/Gym/:gymID',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Gym/:gymID")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Gym/:gymID',
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}}/api/Gym/:gymID'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Gym/:gymID');
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}}/api/Gym/:gymID'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Gym/:gymID';
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}}/api/Gym/:gymID"]
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}}/api/Gym/:gymID" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Gym/:gymID",
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}}/api/Gym/:gymID');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Gym/:gymID');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Gym/:gymID');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Gym/:gymID' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Gym/:gymID' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Gym/:gymID")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Gym/:gymID"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Gym/:gymID"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Gym/:gymID")
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/api/Gym/:gymID') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Gym/:gymID";
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}}/api/Gym/:gymID
http GET {{baseUrl}}/api/Gym/:gymID
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Gym/:gymID
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Gym/:gymID")! 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 new Member
{{baseUrl}}/api/Membership
BODY json
{
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Membership");
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 \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/Membership" {:content-type :json
:form-params {:name ""}})
require "http/client"
url = "{{baseUrl}}/api/Membership"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\"\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}}/api/Membership"),
Content = new StringContent("{\n \"name\": \"\"\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}}/api/Membership");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Membership"
payload := strings.NewReader("{\n \"name\": \"\"\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/api/Membership HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/Membership")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Membership"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\"\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 \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Membership")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/Membership")
.header("content-type", "application/json")
.body("{\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/Membership');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Membership',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Membership';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":""}'
};
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}}/api/Membership',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/Membership")
.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/api/Membership',
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({name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Membership',
headers: {'content-type': 'application/json'},
body: {name: ''},
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}}/api/Membership');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: ''
});
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}}/api/Membership',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Membership';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":""}'
};
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 = @{ @"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Membership"]
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}}/api/Membership" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Membership",
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([
'name' => ''
]),
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}}/api/Membership', [
'body' => '{
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/Membership');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/Membership');
$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}}/api/Membership' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Membership' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/api/Membership", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Membership"
payload = { "name": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Membership"
payload <- "{\n \"name\": \"\"\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}}/api/Membership")
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 \"name\": \"\"\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/api/Membership') do |req|
req.body = "{\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Membership";
let payload = json!({"name": ""});
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}}/api/Membership \
--header 'content-type: application/json' \
--data '{
"name": ""
}'
echo '{
"name": ""
}' | \
http POST {{baseUrl}}/api/Membership \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/api/Membership
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["name": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Membership")! 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()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Membership");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Membership")
require "http/client"
url = "{{baseUrl}}/api/Membership"
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}}/api/Membership"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Membership");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Membership"
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/api/Membership HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Membership")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Membership"))
.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}}/api/Membership")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Membership")
.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}}/api/Membership');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Membership'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Membership';
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}}/api/Membership',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Membership")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Membership',
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}}/api/Membership'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Membership');
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}}/api/Membership'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Membership';
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}}/api/Membership"]
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}}/api/Membership" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Membership",
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}}/api/Membership');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Membership');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Membership');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Membership' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Membership' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Membership")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Membership"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Membership"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Membership")
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/api/Membership') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Membership";
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}}/api/Membership
http GET {{baseUrl}}/api/Membership
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Membership
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Membership")! 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 existing package
{{baseUrl}}/api/Package
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Package");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/api/Package")
require "http/client"
url = "{{baseUrl}}/api/Package"
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}}/api/Package"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Package");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Package"
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/api/Package HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/api/Package")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Package"))
.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}}/api/Package")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/api/Package")
.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}}/api/Package');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/api/Package'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Package';
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}}/api/Package',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Package")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Package',
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}}/api/Package'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/api/Package');
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}}/api/Package'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Package';
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}}/api/Package"]
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}}/api/Package" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Package",
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}}/api/Package');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Package');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Package');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Package' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Package' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/api/Package")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Package"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Package"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Package")
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/api/Package') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Package";
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}}/api/Package
http DELETE {{baseUrl}}/api/Package
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/api/Package
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Package")! 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 package details by packageId
{{baseUrl}}/api/Package
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Package");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Package")
require "http/client"
url = "{{baseUrl}}/api/Package"
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}}/api/Package"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Package");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Package"
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/api/Package HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Package")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Package"))
.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}}/api/Package")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Package")
.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}}/api/Package');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Package'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Package';
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}}/api/Package',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Package")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Package',
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}}/api/Package'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Package');
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}}/api/Package'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Package';
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}}/api/Package"]
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}}/api/Package" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Package",
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}}/api/Package');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Package');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Package');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Package' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Package' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Package")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Package"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Package"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Package")
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/api/Package') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Package";
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}}/api/Package
http GET {{baseUrl}}/api/Package
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Package
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Package")! 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
Insert new package into the system
{{baseUrl}}/api/Package
BODY json
{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Package");
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 \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/Package" {:content-type :json
:form-params {:addOns [{:articleId 0
:articleName ""
:articleNumber 0
:articlePrice ""
:endOrder 0
:isIncludeServiceInCharge false
:measureUnit ""
:numberOfItems ""
:startOrder 0}]
:addonFee ""
:applyForAllGyms false
:availableGyms [{:externalGymNumber 0
:gymId 0
:gymName ""
:location ""}]
:bindingPeriod 0
:createdDate ""
:createdUser ""
:description ""
:endDate ""
:expireInMonths 0
:features ""
:freeMonths 0
:instructionsToGymUsers ""
:instructionsToWebUsers ""
:isActive false
:isAtg false
:isAutoRenew false
:isFirstMonthFree false
:isRegistrationFee false
:isRestAmount false
:isShownInMobile false
:isSponsorPackage false
:maximumGiveAwayRestAmount ""
:memberCanAddAddOns false
:memberCanLeaveWithinFreePeriod false
:memberCanRemoveAddOns false
:modifiedDate ""
:modifiedUser ""
:monthlyFee ""
:nextPackageNumber 0
:numberOfInstallments 0
:numberOfVisits 0
:packageId 0
:packageName ""
:packageNumber ""
:packageType ""
:perVisitPrice ""
:registrationFee ""
:serviceFee ""
:shownInWeb false
:startDate ""
:tags ""
:totalPrice ""}})
require "http/client"
url = "{{baseUrl}}/api/Package"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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}}/api/Package"),
Content = new StringContent("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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}}/api/Package");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Package"
payload := strings.NewReader("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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/api/Package HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1384
{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/Package")
.setHeader("content-type", "application/json")
.setBody("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Package"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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 \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Package")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/Package")
.header("content-type", "application/json")
.body("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}")
.asString();
const data = JSON.stringify({
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [
{
externalGymNumber: 0,
gymId: 0,
gymName: '',
location: ''
}
],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/Package');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Package',
headers: {'content-type': 'application/json'},
data: {
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Package';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"addOns":[{"articleId":0,"articleName":"","articleNumber":0,"articlePrice":"","endOrder":0,"isIncludeServiceInCharge":false,"measureUnit":"","numberOfItems":"","startOrder":0}],"addonFee":"","applyForAllGyms":false,"availableGyms":[{"externalGymNumber":0,"gymId":0,"gymName":"","location":""}],"bindingPeriod":0,"createdDate":"","createdUser":"","description":"","endDate":"","expireInMonths":0,"features":"","freeMonths":0,"instructionsToGymUsers":"","instructionsToWebUsers":"","isActive":false,"isAtg":false,"isAutoRenew":false,"isFirstMonthFree":false,"isRegistrationFee":false,"isRestAmount":false,"isShownInMobile":false,"isSponsorPackage":false,"maximumGiveAwayRestAmount":"","memberCanAddAddOns":false,"memberCanLeaveWithinFreePeriod":false,"memberCanRemoveAddOns":false,"modifiedDate":"","modifiedUser":"","monthlyFee":"","nextPackageNumber":0,"numberOfInstallments":0,"numberOfVisits":0,"packageId":0,"packageName":"","packageNumber":"","packageType":"","perVisitPrice":"","registrationFee":"","serviceFee":"","shownInWeb":false,"startDate":"","tags":"","totalPrice":""}'
};
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}}/api/Package',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "addOns": [\n {\n "articleId": 0,\n "articleName": "",\n "articleNumber": 0,\n "articlePrice": "",\n "endOrder": 0,\n "isIncludeServiceInCharge": false,\n "measureUnit": "",\n "numberOfItems": "",\n "startOrder": 0\n }\n ],\n "addonFee": "",\n "applyForAllGyms": false,\n "availableGyms": [\n {\n "externalGymNumber": 0,\n "gymId": 0,\n "gymName": "",\n "location": ""\n }\n ],\n "bindingPeriod": 0,\n "createdDate": "",\n "createdUser": "",\n "description": "",\n "endDate": "",\n "expireInMonths": 0,\n "features": "",\n "freeMonths": 0,\n "instructionsToGymUsers": "",\n "instructionsToWebUsers": "",\n "isActive": false,\n "isAtg": false,\n "isAutoRenew": false,\n "isFirstMonthFree": false,\n "isRegistrationFee": false,\n "isRestAmount": false,\n "isShownInMobile": false,\n "isSponsorPackage": false,\n "maximumGiveAwayRestAmount": "",\n "memberCanAddAddOns": false,\n "memberCanLeaveWithinFreePeriod": false,\n "memberCanRemoveAddOns": false,\n "modifiedDate": "",\n "modifiedUser": "",\n "monthlyFee": "",\n "nextPackageNumber": 0,\n "numberOfInstallments": 0,\n "numberOfVisits": 0,\n "packageId": 0,\n "packageName": "",\n "packageNumber": "",\n "packageType": "",\n "perVisitPrice": "",\n "registrationFee": "",\n "serviceFee": "",\n "shownInWeb": false,\n "startDate": "",\n "tags": "",\n "totalPrice": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/Package")
.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/api/Package',
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({
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/Package',
headers: {'content-type': 'application/json'},
body: {
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
},
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}}/api/Package');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [
{
externalGymNumber: 0,
gymId: 0,
gymName: '',
location: ''
}
],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
});
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}}/api/Package',
headers: {'content-type': 'application/json'},
data: {
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Package';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"addOns":[{"articleId":0,"articleName":"","articleNumber":0,"articlePrice":"","endOrder":0,"isIncludeServiceInCharge":false,"measureUnit":"","numberOfItems":"","startOrder":0}],"addonFee":"","applyForAllGyms":false,"availableGyms":[{"externalGymNumber":0,"gymId":0,"gymName":"","location":""}],"bindingPeriod":0,"createdDate":"","createdUser":"","description":"","endDate":"","expireInMonths":0,"features":"","freeMonths":0,"instructionsToGymUsers":"","instructionsToWebUsers":"","isActive":false,"isAtg":false,"isAutoRenew":false,"isFirstMonthFree":false,"isRegistrationFee":false,"isRestAmount":false,"isShownInMobile":false,"isSponsorPackage":false,"maximumGiveAwayRestAmount":"","memberCanAddAddOns":false,"memberCanLeaveWithinFreePeriod":false,"memberCanRemoveAddOns":false,"modifiedDate":"","modifiedUser":"","monthlyFee":"","nextPackageNumber":0,"numberOfInstallments":0,"numberOfVisits":0,"packageId":0,"packageName":"","packageNumber":"","packageType":"","perVisitPrice":"","registrationFee":"","serviceFee":"","shownInWeb":false,"startDate":"","tags":"","totalPrice":""}'
};
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 = @{ @"addOns": @[ @{ @"articleId": @0, @"articleName": @"", @"articleNumber": @0, @"articlePrice": @"", @"endOrder": @0, @"isIncludeServiceInCharge": @NO, @"measureUnit": @"", @"numberOfItems": @"", @"startOrder": @0 } ],
@"addonFee": @"",
@"applyForAllGyms": @NO,
@"availableGyms": @[ @{ @"externalGymNumber": @0, @"gymId": @0, @"gymName": @"", @"location": @"" } ],
@"bindingPeriod": @0,
@"createdDate": @"",
@"createdUser": @"",
@"description": @"",
@"endDate": @"",
@"expireInMonths": @0,
@"features": @"",
@"freeMonths": @0,
@"instructionsToGymUsers": @"",
@"instructionsToWebUsers": @"",
@"isActive": @NO,
@"isAtg": @NO,
@"isAutoRenew": @NO,
@"isFirstMonthFree": @NO,
@"isRegistrationFee": @NO,
@"isRestAmount": @NO,
@"isShownInMobile": @NO,
@"isSponsorPackage": @NO,
@"maximumGiveAwayRestAmount": @"",
@"memberCanAddAddOns": @NO,
@"memberCanLeaveWithinFreePeriod": @NO,
@"memberCanRemoveAddOns": @NO,
@"modifiedDate": @"",
@"modifiedUser": @"",
@"monthlyFee": @"",
@"nextPackageNumber": @0,
@"numberOfInstallments": @0,
@"numberOfVisits": @0,
@"packageId": @0,
@"packageName": @"",
@"packageNumber": @"",
@"packageType": @"",
@"perVisitPrice": @"",
@"registrationFee": @"",
@"serviceFee": @"",
@"shownInWeb": @NO,
@"startDate": @"",
@"tags": @"",
@"totalPrice": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Package"]
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}}/api/Package" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Package",
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([
'addOns' => [
[
'articleId' => 0,
'articleName' => '',
'articleNumber' => 0,
'articlePrice' => '',
'endOrder' => 0,
'isIncludeServiceInCharge' => null,
'measureUnit' => '',
'numberOfItems' => '',
'startOrder' => 0
]
],
'addonFee' => '',
'applyForAllGyms' => null,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'bindingPeriod' => 0,
'createdDate' => '',
'createdUser' => '',
'description' => '',
'endDate' => '',
'expireInMonths' => 0,
'features' => '',
'freeMonths' => 0,
'instructionsToGymUsers' => '',
'instructionsToWebUsers' => '',
'isActive' => null,
'isAtg' => null,
'isAutoRenew' => null,
'isFirstMonthFree' => null,
'isRegistrationFee' => null,
'isRestAmount' => null,
'isShownInMobile' => null,
'isSponsorPackage' => null,
'maximumGiveAwayRestAmount' => '',
'memberCanAddAddOns' => null,
'memberCanLeaveWithinFreePeriod' => null,
'memberCanRemoveAddOns' => null,
'modifiedDate' => '',
'modifiedUser' => '',
'monthlyFee' => '',
'nextPackageNumber' => 0,
'numberOfInstallments' => 0,
'numberOfVisits' => 0,
'packageId' => 0,
'packageName' => '',
'packageNumber' => '',
'packageType' => '',
'perVisitPrice' => '',
'registrationFee' => '',
'serviceFee' => '',
'shownInWeb' => null,
'startDate' => '',
'tags' => '',
'totalPrice' => ''
]),
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}}/api/Package', [
'body' => '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/Package');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'addOns' => [
[
'articleId' => 0,
'articleName' => '',
'articleNumber' => 0,
'articlePrice' => '',
'endOrder' => 0,
'isIncludeServiceInCharge' => null,
'measureUnit' => '',
'numberOfItems' => '',
'startOrder' => 0
]
],
'addonFee' => '',
'applyForAllGyms' => null,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'bindingPeriod' => 0,
'createdDate' => '',
'createdUser' => '',
'description' => '',
'endDate' => '',
'expireInMonths' => 0,
'features' => '',
'freeMonths' => 0,
'instructionsToGymUsers' => '',
'instructionsToWebUsers' => '',
'isActive' => null,
'isAtg' => null,
'isAutoRenew' => null,
'isFirstMonthFree' => null,
'isRegistrationFee' => null,
'isRestAmount' => null,
'isShownInMobile' => null,
'isSponsorPackage' => null,
'maximumGiveAwayRestAmount' => '',
'memberCanAddAddOns' => null,
'memberCanLeaveWithinFreePeriod' => null,
'memberCanRemoveAddOns' => null,
'modifiedDate' => '',
'modifiedUser' => '',
'monthlyFee' => '',
'nextPackageNumber' => 0,
'numberOfInstallments' => 0,
'numberOfVisits' => 0,
'packageId' => 0,
'packageName' => '',
'packageNumber' => '',
'packageType' => '',
'perVisitPrice' => '',
'registrationFee' => '',
'serviceFee' => '',
'shownInWeb' => null,
'startDate' => '',
'tags' => '',
'totalPrice' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'addOns' => [
[
'articleId' => 0,
'articleName' => '',
'articleNumber' => 0,
'articlePrice' => '',
'endOrder' => 0,
'isIncludeServiceInCharge' => null,
'measureUnit' => '',
'numberOfItems' => '',
'startOrder' => 0
]
],
'addonFee' => '',
'applyForAllGyms' => null,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'bindingPeriod' => 0,
'createdDate' => '',
'createdUser' => '',
'description' => '',
'endDate' => '',
'expireInMonths' => 0,
'features' => '',
'freeMonths' => 0,
'instructionsToGymUsers' => '',
'instructionsToWebUsers' => '',
'isActive' => null,
'isAtg' => null,
'isAutoRenew' => null,
'isFirstMonthFree' => null,
'isRegistrationFee' => null,
'isRestAmount' => null,
'isShownInMobile' => null,
'isSponsorPackage' => null,
'maximumGiveAwayRestAmount' => '',
'memberCanAddAddOns' => null,
'memberCanLeaveWithinFreePeriod' => null,
'memberCanRemoveAddOns' => null,
'modifiedDate' => '',
'modifiedUser' => '',
'monthlyFee' => '',
'nextPackageNumber' => 0,
'numberOfInstallments' => 0,
'numberOfVisits' => 0,
'packageId' => 0,
'packageName' => '',
'packageNumber' => '',
'packageType' => '',
'perVisitPrice' => '',
'registrationFee' => '',
'serviceFee' => '',
'shownInWeb' => null,
'startDate' => '',
'tags' => '',
'totalPrice' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/Package');
$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}}/api/Package' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Package' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/api/Package", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Package"
payload = {
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": False,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": False,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": False,
"isAtg": False,
"isAutoRenew": False,
"isFirstMonthFree": False,
"isRegistrationFee": False,
"isRestAmount": False,
"isShownInMobile": False,
"isSponsorPackage": False,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": False,
"memberCanLeaveWithinFreePeriod": False,
"memberCanRemoveAddOns": False,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": False,
"startDate": "",
"tags": "",
"totalPrice": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Package"
payload <- "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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}}/api/Package")
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 \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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/api/Package') do |req|
req.body = "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Package";
let payload = json!({
"addOns": (
json!({
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
})
),
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": (
json!({
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
})
),
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
});
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}}/api/Package \
--header 'content-type: application/json' \
--data '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}'
echo '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}' | \
http POST {{baseUrl}}/api/Package \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "addOns": [\n {\n "articleId": 0,\n "articleName": "",\n "articleNumber": 0,\n "articlePrice": "",\n "endOrder": 0,\n "isIncludeServiceInCharge": false,\n "measureUnit": "",\n "numberOfItems": "",\n "startOrder": 0\n }\n ],\n "addonFee": "",\n "applyForAllGyms": false,\n "availableGyms": [\n {\n "externalGymNumber": 0,\n "gymId": 0,\n "gymName": "",\n "location": ""\n }\n ],\n "bindingPeriod": 0,\n "createdDate": "",\n "createdUser": "",\n "description": "",\n "endDate": "",\n "expireInMonths": 0,\n "features": "",\n "freeMonths": 0,\n "instructionsToGymUsers": "",\n "instructionsToWebUsers": "",\n "isActive": false,\n "isAtg": false,\n "isAutoRenew": false,\n "isFirstMonthFree": false,\n "isRegistrationFee": false,\n "isRestAmount": false,\n "isShownInMobile": false,\n "isSponsorPackage": false,\n "maximumGiveAwayRestAmount": "",\n "memberCanAddAddOns": false,\n "memberCanLeaveWithinFreePeriod": false,\n "memberCanRemoveAddOns": false,\n "modifiedDate": "",\n "modifiedUser": "",\n "monthlyFee": "",\n "nextPackageNumber": 0,\n "numberOfInstallments": 0,\n "numberOfVisits": 0,\n "packageId": 0,\n "packageName": "",\n "packageNumber": "",\n "packageType": "",\n "perVisitPrice": "",\n "registrationFee": "",\n "serviceFee": "",\n "shownInWeb": false,\n "startDate": "",\n "tags": "",\n "totalPrice": ""\n}' \
--output-document \
- {{baseUrl}}/api/Package
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"addOns": [
[
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
]
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
[
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
]
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Package")! 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
Search packages
{{baseUrl}}/api/Package/Search
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Package/Search");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Package/Search")
require "http/client"
url = "{{baseUrl}}/api/Package/Search"
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}}/api/Package/Search"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Package/Search");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Package/Search"
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/api/Package/Search HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Package/Search")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Package/Search"))
.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}}/api/Package/Search")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Package/Search")
.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}}/api/Package/Search');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Package/Search'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Package/Search';
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}}/api/Package/Search',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Package/Search")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Package/Search',
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}}/api/Package/Search'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Package/Search');
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}}/api/Package/Search'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Package/Search';
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}}/api/Package/Search"]
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}}/api/Package/Search" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Package/Search",
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}}/api/Package/Search');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Package/Search');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Package/Search');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Package/Search' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Package/Search' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Package/Search")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Package/Search"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Package/Search"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Package/Search")
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/api/Package/Search') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Package/Search";
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}}/api/Package/Search
http GET {{baseUrl}}/api/Package/Search
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Package/Search
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Package/Search")! 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
Status update of existing package
{{baseUrl}}/api/Package/UpdateStatus
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Package/UpdateStatus");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/Package/UpdateStatus")
require "http/client"
url = "{{baseUrl}}/api/Package/UpdateStatus"
response = HTTP::Client.put url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/api/Package/UpdateStatus"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Package/UpdateStatus");
var request = new RestRequest("", Method.Put);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Package/UpdateStatus"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/api/Package/UpdateStatus HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/Package/UpdateStatus")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Package/UpdateStatus"))
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Package/UpdateStatus")
.put(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/Package/UpdateStatus")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/Package/UpdateStatus');
xhr.send(data);
import axios from 'axios';
const options = {method: 'PUT', url: '{{baseUrl}}/api/Package/UpdateStatus'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Package/UpdateStatus';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/Package/UpdateStatus',
method: 'PUT',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Package/UpdateStatus")
.put(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Package/UpdateStatus',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'PUT', url: '{{baseUrl}}/api/Package/UpdateStatus'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/Package/UpdateStatus');
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}}/api/Package/UpdateStatus'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Package/UpdateStatus';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Package/UpdateStatus"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/Package/UpdateStatus" in
Client.call `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Package/UpdateStatus",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/Package/UpdateStatus');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Package/UpdateStatus');
$request->setMethod(HTTP_METH_PUT);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Package/UpdateStatus');
$request->setRequestMethod('PUT');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Package/UpdateStatus' -Method PUT
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Package/UpdateStatus' -Method PUT
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("PUT", "/baseUrl/api/Package/UpdateStatus")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Package/UpdateStatus"
response = requests.put(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Package/UpdateStatus"
response <- VERB("PUT", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Package/UpdateStatus")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/api/Package/UpdateStatus') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Package/UpdateStatus";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/api/Package/UpdateStatus
http PUT {{baseUrl}}/api/Package/UpdateStatus
wget --quiet \
--method PUT \
--output-document \
- {{baseUrl}}/api/Package/UpdateStatus
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Package/UpdateStatus")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Update existing package by its ID
{{baseUrl}}/api/Package
BODY json
{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Package");
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 \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/Package" {:content-type :json
:form-params {:addOns [{:articleId 0
:articleName ""
:articleNumber 0
:articlePrice ""
:endOrder 0
:isIncludeServiceInCharge false
:measureUnit ""
:numberOfItems ""
:startOrder 0}]
:addonFee ""
:applyForAllGyms false
:availableGyms [{:externalGymNumber 0
:gymId 0
:gymName ""
:location ""}]
:bindingPeriod 0
:createdDate ""
:createdUser ""
:description ""
:endDate ""
:expireInMonths 0
:features ""
:freeMonths 0
:instructionsToGymUsers ""
:instructionsToWebUsers ""
:isActive false
:isAtg false
:isAutoRenew false
:isFirstMonthFree false
:isRegistrationFee false
:isRestAmount false
:isShownInMobile false
:isSponsorPackage false
:maximumGiveAwayRestAmount ""
:memberCanAddAddOns false
:memberCanLeaveWithinFreePeriod false
:memberCanRemoveAddOns false
:modifiedDate ""
:modifiedUser ""
:monthlyFee ""
:nextPackageNumber 0
:numberOfInstallments 0
:numberOfVisits 0
:packageId 0
:packageName ""
:packageNumber ""
:packageType ""
:perVisitPrice ""
:registrationFee ""
:serviceFee ""
:shownInWeb false
:startDate ""
:tags ""
:totalPrice ""}})
require "http/client"
url = "{{baseUrl}}/api/Package"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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}}/api/Package"),
Content = new StringContent("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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}}/api/Package");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Package"
payload := strings.NewReader("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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/api/Package HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1384
{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/Package")
.setHeader("content-type", "application/json")
.setBody("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Package"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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 \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/Package")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/Package")
.header("content-type", "application/json")
.body("{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}")
.asString();
const data = JSON.stringify({
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [
{
externalGymNumber: 0,
gymId: 0,
gymName: '',
location: ''
}
],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/Package');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/Package',
headers: {'content-type': 'application/json'},
data: {
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Package';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"addOns":[{"articleId":0,"articleName":"","articleNumber":0,"articlePrice":"","endOrder":0,"isIncludeServiceInCharge":false,"measureUnit":"","numberOfItems":"","startOrder":0}],"addonFee":"","applyForAllGyms":false,"availableGyms":[{"externalGymNumber":0,"gymId":0,"gymName":"","location":""}],"bindingPeriod":0,"createdDate":"","createdUser":"","description":"","endDate":"","expireInMonths":0,"features":"","freeMonths":0,"instructionsToGymUsers":"","instructionsToWebUsers":"","isActive":false,"isAtg":false,"isAutoRenew":false,"isFirstMonthFree":false,"isRegistrationFee":false,"isRestAmount":false,"isShownInMobile":false,"isSponsorPackage":false,"maximumGiveAwayRestAmount":"","memberCanAddAddOns":false,"memberCanLeaveWithinFreePeriod":false,"memberCanRemoveAddOns":false,"modifiedDate":"","modifiedUser":"","monthlyFee":"","nextPackageNumber":0,"numberOfInstallments":0,"numberOfVisits":0,"packageId":0,"packageName":"","packageNumber":"","packageType":"","perVisitPrice":"","registrationFee":"","serviceFee":"","shownInWeb":false,"startDate":"","tags":"","totalPrice":""}'
};
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}}/api/Package',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "addOns": [\n {\n "articleId": 0,\n "articleName": "",\n "articleNumber": 0,\n "articlePrice": "",\n "endOrder": 0,\n "isIncludeServiceInCharge": false,\n "measureUnit": "",\n "numberOfItems": "",\n "startOrder": 0\n }\n ],\n "addonFee": "",\n "applyForAllGyms": false,\n "availableGyms": [\n {\n "externalGymNumber": 0,\n "gymId": 0,\n "gymName": "",\n "location": ""\n }\n ],\n "bindingPeriod": 0,\n "createdDate": "",\n "createdUser": "",\n "description": "",\n "endDate": "",\n "expireInMonths": 0,\n "features": "",\n "freeMonths": 0,\n "instructionsToGymUsers": "",\n "instructionsToWebUsers": "",\n "isActive": false,\n "isAtg": false,\n "isAutoRenew": false,\n "isFirstMonthFree": false,\n "isRegistrationFee": false,\n "isRestAmount": false,\n "isShownInMobile": false,\n "isSponsorPackage": false,\n "maximumGiveAwayRestAmount": "",\n "memberCanAddAddOns": false,\n "memberCanLeaveWithinFreePeriod": false,\n "memberCanRemoveAddOns": false,\n "modifiedDate": "",\n "modifiedUser": "",\n "monthlyFee": "",\n "nextPackageNumber": 0,\n "numberOfInstallments": 0,\n "numberOfVisits": 0,\n "packageId": 0,\n "packageName": "",\n "packageNumber": "",\n "packageType": "",\n "perVisitPrice": "",\n "registrationFee": "",\n "serviceFee": "",\n "shownInWeb": false,\n "startDate": "",\n "tags": "",\n "totalPrice": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/Package")
.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/api/Package',
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({
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/Package',
headers: {'content-type': 'application/json'},
body: {
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
},
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}}/api/Package');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [
{
externalGymNumber: 0,
gymId: 0,
gymName: '',
location: ''
}
],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
});
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}}/api/Package',
headers: {'content-type': 'application/json'},
data: {
addOns: [
{
articleId: 0,
articleName: '',
articleNumber: 0,
articlePrice: '',
endOrder: 0,
isIncludeServiceInCharge: false,
measureUnit: '',
numberOfItems: '',
startOrder: 0
}
],
addonFee: '',
applyForAllGyms: false,
availableGyms: [{externalGymNumber: 0, gymId: 0, gymName: '', location: ''}],
bindingPeriod: 0,
createdDate: '',
createdUser: '',
description: '',
endDate: '',
expireInMonths: 0,
features: '',
freeMonths: 0,
instructionsToGymUsers: '',
instructionsToWebUsers: '',
isActive: false,
isAtg: false,
isAutoRenew: false,
isFirstMonthFree: false,
isRegistrationFee: false,
isRestAmount: false,
isShownInMobile: false,
isSponsorPackage: false,
maximumGiveAwayRestAmount: '',
memberCanAddAddOns: false,
memberCanLeaveWithinFreePeriod: false,
memberCanRemoveAddOns: false,
modifiedDate: '',
modifiedUser: '',
monthlyFee: '',
nextPackageNumber: 0,
numberOfInstallments: 0,
numberOfVisits: 0,
packageId: 0,
packageName: '',
packageNumber: '',
packageType: '',
perVisitPrice: '',
registrationFee: '',
serviceFee: '',
shownInWeb: false,
startDate: '',
tags: '',
totalPrice: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Package';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"addOns":[{"articleId":0,"articleName":"","articleNumber":0,"articlePrice":"","endOrder":0,"isIncludeServiceInCharge":false,"measureUnit":"","numberOfItems":"","startOrder":0}],"addonFee":"","applyForAllGyms":false,"availableGyms":[{"externalGymNumber":0,"gymId":0,"gymName":"","location":""}],"bindingPeriod":0,"createdDate":"","createdUser":"","description":"","endDate":"","expireInMonths":0,"features":"","freeMonths":0,"instructionsToGymUsers":"","instructionsToWebUsers":"","isActive":false,"isAtg":false,"isAutoRenew":false,"isFirstMonthFree":false,"isRegistrationFee":false,"isRestAmount":false,"isShownInMobile":false,"isSponsorPackage":false,"maximumGiveAwayRestAmount":"","memberCanAddAddOns":false,"memberCanLeaveWithinFreePeriod":false,"memberCanRemoveAddOns":false,"modifiedDate":"","modifiedUser":"","monthlyFee":"","nextPackageNumber":0,"numberOfInstallments":0,"numberOfVisits":0,"packageId":0,"packageName":"","packageNumber":"","packageType":"","perVisitPrice":"","registrationFee":"","serviceFee":"","shownInWeb":false,"startDate":"","tags":"","totalPrice":""}'
};
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 = @{ @"addOns": @[ @{ @"articleId": @0, @"articleName": @"", @"articleNumber": @0, @"articlePrice": @"", @"endOrder": @0, @"isIncludeServiceInCharge": @NO, @"measureUnit": @"", @"numberOfItems": @"", @"startOrder": @0 } ],
@"addonFee": @"",
@"applyForAllGyms": @NO,
@"availableGyms": @[ @{ @"externalGymNumber": @0, @"gymId": @0, @"gymName": @"", @"location": @"" } ],
@"bindingPeriod": @0,
@"createdDate": @"",
@"createdUser": @"",
@"description": @"",
@"endDate": @"",
@"expireInMonths": @0,
@"features": @"",
@"freeMonths": @0,
@"instructionsToGymUsers": @"",
@"instructionsToWebUsers": @"",
@"isActive": @NO,
@"isAtg": @NO,
@"isAutoRenew": @NO,
@"isFirstMonthFree": @NO,
@"isRegistrationFee": @NO,
@"isRestAmount": @NO,
@"isShownInMobile": @NO,
@"isSponsorPackage": @NO,
@"maximumGiveAwayRestAmount": @"",
@"memberCanAddAddOns": @NO,
@"memberCanLeaveWithinFreePeriod": @NO,
@"memberCanRemoveAddOns": @NO,
@"modifiedDate": @"",
@"modifiedUser": @"",
@"monthlyFee": @"",
@"nextPackageNumber": @0,
@"numberOfInstallments": @0,
@"numberOfVisits": @0,
@"packageId": @0,
@"packageName": @"",
@"packageNumber": @"",
@"packageType": @"",
@"perVisitPrice": @"",
@"registrationFee": @"",
@"serviceFee": @"",
@"shownInWeb": @NO,
@"startDate": @"",
@"tags": @"",
@"totalPrice": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/Package"]
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}}/api/Package" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Package",
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([
'addOns' => [
[
'articleId' => 0,
'articleName' => '',
'articleNumber' => 0,
'articlePrice' => '',
'endOrder' => 0,
'isIncludeServiceInCharge' => null,
'measureUnit' => '',
'numberOfItems' => '',
'startOrder' => 0
]
],
'addonFee' => '',
'applyForAllGyms' => null,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'bindingPeriod' => 0,
'createdDate' => '',
'createdUser' => '',
'description' => '',
'endDate' => '',
'expireInMonths' => 0,
'features' => '',
'freeMonths' => 0,
'instructionsToGymUsers' => '',
'instructionsToWebUsers' => '',
'isActive' => null,
'isAtg' => null,
'isAutoRenew' => null,
'isFirstMonthFree' => null,
'isRegistrationFee' => null,
'isRestAmount' => null,
'isShownInMobile' => null,
'isSponsorPackage' => null,
'maximumGiveAwayRestAmount' => '',
'memberCanAddAddOns' => null,
'memberCanLeaveWithinFreePeriod' => null,
'memberCanRemoveAddOns' => null,
'modifiedDate' => '',
'modifiedUser' => '',
'monthlyFee' => '',
'nextPackageNumber' => 0,
'numberOfInstallments' => 0,
'numberOfVisits' => 0,
'packageId' => 0,
'packageName' => '',
'packageNumber' => '',
'packageType' => '',
'perVisitPrice' => '',
'registrationFee' => '',
'serviceFee' => '',
'shownInWeb' => null,
'startDate' => '',
'tags' => '',
'totalPrice' => ''
]),
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}}/api/Package', [
'body' => '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/Package');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'addOns' => [
[
'articleId' => 0,
'articleName' => '',
'articleNumber' => 0,
'articlePrice' => '',
'endOrder' => 0,
'isIncludeServiceInCharge' => null,
'measureUnit' => '',
'numberOfItems' => '',
'startOrder' => 0
]
],
'addonFee' => '',
'applyForAllGyms' => null,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'bindingPeriod' => 0,
'createdDate' => '',
'createdUser' => '',
'description' => '',
'endDate' => '',
'expireInMonths' => 0,
'features' => '',
'freeMonths' => 0,
'instructionsToGymUsers' => '',
'instructionsToWebUsers' => '',
'isActive' => null,
'isAtg' => null,
'isAutoRenew' => null,
'isFirstMonthFree' => null,
'isRegistrationFee' => null,
'isRestAmount' => null,
'isShownInMobile' => null,
'isSponsorPackage' => null,
'maximumGiveAwayRestAmount' => '',
'memberCanAddAddOns' => null,
'memberCanLeaveWithinFreePeriod' => null,
'memberCanRemoveAddOns' => null,
'modifiedDate' => '',
'modifiedUser' => '',
'monthlyFee' => '',
'nextPackageNumber' => 0,
'numberOfInstallments' => 0,
'numberOfVisits' => 0,
'packageId' => 0,
'packageName' => '',
'packageNumber' => '',
'packageType' => '',
'perVisitPrice' => '',
'registrationFee' => '',
'serviceFee' => '',
'shownInWeb' => null,
'startDate' => '',
'tags' => '',
'totalPrice' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'addOns' => [
[
'articleId' => 0,
'articleName' => '',
'articleNumber' => 0,
'articlePrice' => '',
'endOrder' => 0,
'isIncludeServiceInCharge' => null,
'measureUnit' => '',
'numberOfItems' => '',
'startOrder' => 0
]
],
'addonFee' => '',
'applyForAllGyms' => null,
'availableGyms' => [
[
'externalGymNumber' => 0,
'gymId' => 0,
'gymName' => '',
'location' => ''
]
],
'bindingPeriod' => 0,
'createdDate' => '',
'createdUser' => '',
'description' => '',
'endDate' => '',
'expireInMonths' => 0,
'features' => '',
'freeMonths' => 0,
'instructionsToGymUsers' => '',
'instructionsToWebUsers' => '',
'isActive' => null,
'isAtg' => null,
'isAutoRenew' => null,
'isFirstMonthFree' => null,
'isRegistrationFee' => null,
'isRestAmount' => null,
'isShownInMobile' => null,
'isSponsorPackage' => null,
'maximumGiveAwayRestAmount' => '',
'memberCanAddAddOns' => null,
'memberCanLeaveWithinFreePeriod' => null,
'memberCanRemoveAddOns' => null,
'modifiedDate' => '',
'modifiedUser' => '',
'monthlyFee' => '',
'nextPackageNumber' => 0,
'numberOfInstallments' => 0,
'numberOfVisits' => 0,
'packageId' => 0,
'packageName' => '',
'packageNumber' => '',
'packageType' => '',
'perVisitPrice' => '',
'registrationFee' => '',
'serviceFee' => '',
'shownInWeb' => null,
'startDate' => '',
'tags' => '',
'totalPrice' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/Package');
$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}}/api/Package' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Package' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/api/Package", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Package"
payload = {
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": False,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": False,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": False,
"isAtg": False,
"isAutoRenew": False,
"isFirstMonthFree": False,
"isRegistrationFee": False,
"isRestAmount": False,
"isShownInMobile": False,
"isSponsorPackage": False,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": False,
"memberCanLeaveWithinFreePeriod": False,
"memberCanRemoveAddOns": False,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": False,
"startDate": "",
"tags": "",
"totalPrice": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Package"
payload <- "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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}}/api/Package")
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 \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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/api/Package') do |req|
req.body = "{\n \"addOns\": [\n {\n \"articleId\": 0,\n \"articleName\": \"\",\n \"articleNumber\": 0,\n \"articlePrice\": \"\",\n \"endOrder\": 0,\n \"isIncludeServiceInCharge\": false,\n \"measureUnit\": \"\",\n \"numberOfItems\": \"\",\n \"startOrder\": 0\n }\n ],\n \"addonFee\": \"\",\n \"applyForAllGyms\": false,\n \"availableGyms\": [\n {\n \"externalGymNumber\": 0,\n \"gymId\": 0,\n \"gymName\": \"\",\n \"location\": \"\"\n }\n ],\n \"bindingPeriod\": 0,\n \"createdDate\": \"\",\n \"createdUser\": \"\",\n \"description\": \"\",\n \"endDate\": \"\",\n \"expireInMonths\": 0,\n \"features\": \"\",\n \"freeMonths\": 0,\n \"instructionsToGymUsers\": \"\",\n \"instructionsToWebUsers\": \"\",\n \"isActive\": false,\n \"isAtg\": false,\n \"isAutoRenew\": false,\n \"isFirstMonthFree\": false,\n \"isRegistrationFee\": false,\n \"isRestAmount\": false,\n \"isShownInMobile\": false,\n \"isSponsorPackage\": false,\n \"maximumGiveAwayRestAmount\": \"\",\n \"memberCanAddAddOns\": false,\n \"memberCanLeaveWithinFreePeriod\": false,\n \"memberCanRemoveAddOns\": false,\n \"modifiedDate\": \"\",\n \"modifiedUser\": \"\",\n \"monthlyFee\": \"\",\n \"nextPackageNumber\": 0,\n \"numberOfInstallments\": 0,\n \"numberOfVisits\": 0,\n \"packageId\": 0,\n \"packageName\": \"\",\n \"packageNumber\": \"\",\n \"packageType\": \"\",\n \"perVisitPrice\": \"\",\n \"registrationFee\": \"\",\n \"serviceFee\": \"\",\n \"shownInWeb\": false,\n \"startDate\": \"\",\n \"tags\": \"\",\n \"totalPrice\": \"\"\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}}/api/Package";
let payload = json!({
"addOns": (
json!({
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
})
),
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": (
json!({
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
})
),
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
});
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}}/api/Package \
--header 'content-type: application/json' \
--data '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}'
echo '{
"addOns": [
{
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
}
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
{
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
}
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
}' | \
http PUT {{baseUrl}}/api/Package \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "addOns": [\n {\n "articleId": 0,\n "articleName": "",\n "articleNumber": 0,\n "articlePrice": "",\n "endOrder": 0,\n "isIncludeServiceInCharge": false,\n "measureUnit": "",\n "numberOfItems": "",\n "startOrder": 0\n }\n ],\n "addonFee": "",\n "applyForAllGyms": false,\n "availableGyms": [\n {\n "externalGymNumber": 0,\n "gymId": 0,\n "gymName": "",\n "location": ""\n }\n ],\n "bindingPeriod": 0,\n "createdDate": "",\n "createdUser": "",\n "description": "",\n "endDate": "",\n "expireInMonths": 0,\n "features": "",\n "freeMonths": 0,\n "instructionsToGymUsers": "",\n "instructionsToWebUsers": "",\n "isActive": false,\n "isAtg": false,\n "isAutoRenew": false,\n "isFirstMonthFree": false,\n "isRegistrationFee": false,\n "isRestAmount": false,\n "isShownInMobile": false,\n "isSponsorPackage": false,\n "maximumGiveAwayRestAmount": "",\n "memberCanAddAddOns": false,\n "memberCanLeaveWithinFreePeriod": false,\n "memberCanRemoveAddOns": false,\n "modifiedDate": "",\n "modifiedUser": "",\n "monthlyFee": "",\n "nextPackageNumber": 0,\n "numberOfInstallments": 0,\n "numberOfVisits": 0,\n "packageId": 0,\n "packageName": "",\n "packageNumber": "",\n "packageType": "",\n "perVisitPrice": "",\n "registrationFee": "",\n "serviceFee": "",\n "shownInWeb": false,\n "startDate": "",\n "tags": "",\n "totalPrice": ""\n}' \
--output-document \
- {{baseUrl}}/api/Package
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"addOns": [
[
"articleId": 0,
"articleName": "",
"articleNumber": 0,
"articlePrice": "",
"endOrder": 0,
"isIncludeServiceInCharge": false,
"measureUnit": "",
"numberOfItems": "",
"startOrder": 0
]
],
"addonFee": "",
"applyForAllGyms": false,
"availableGyms": [
[
"externalGymNumber": 0,
"gymId": 0,
"gymName": "",
"location": ""
]
],
"bindingPeriod": 0,
"createdDate": "",
"createdUser": "",
"description": "",
"endDate": "",
"expireInMonths": 0,
"features": "",
"freeMonths": 0,
"instructionsToGymUsers": "",
"instructionsToWebUsers": "",
"isActive": false,
"isAtg": false,
"isAutoRenew": false,
"isFirstMonthFree": false,
"isRegistrationFee": false,
"isRestAmount": false,
"isShownInMobile": false,
"isSponsorPackage": false,
"maximumGiveAwayRestAmount": "",
"memberCanAddAddOns": false,
"memberCanLeaveWithinFreePeriod": false,
"memberCanRemoveAddOns": false,
"modifiedDate": "",
"modifiedUser": "",
"monthlyFee": "",
"nextPackageNumber": 0,
"numberOfInstallments": 0,
"numberOfVisits": 0,
"packageId": 0,
"packageName": "",
"packageNumber": "",
"packageType": "",
"perVisitPrice": "",
"registrationFee": "",
"serviceFee": "",
"shownInWeb": false,
"startDate": "",
"tags": "",
"totalPrice": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Package")! 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 the current status of message
{{baseUrl}}/api/Status
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Status");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Status")
require "http/client"
url = "{{baseUrl}}/api/Status"
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}}/api/Status"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Status");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Status"
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/api/Status HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Status")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Status"))
.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}}/api/Status")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Status")
.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}}/api/Status');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Status'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Status';
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}}/api/Status',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Status")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Status',
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}}/api/Status'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Status');
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}}/api/Status'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Status';
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}}/api/Status"]
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}}/api/Status" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Status",
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}}/api/Status');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Status');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Status');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Status' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Status' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Status")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Status"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Status"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Status")
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/api/Status') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Status";
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}}/api/Status
http GET {{baseUrl}}/api/Status
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Status
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Status")! 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 all Test objects.
{{baseUrl}}/api/Test
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/Test");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/Test")
require "http/client"
url = "{{baseUrl}}/api/Test"
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}}/api/Test"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/Test");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/Test"
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/api/Test HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/Test")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/Test"))
.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}}/api/Test")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/Test")
.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}}/api/Test');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/Test'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/Test';
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}}/api/Test',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/Test")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/Test',
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}}/api/Test'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/Test');
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}}/api/Test'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/Test';
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}}/api/Test"]
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}}/api/Test" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/Test",
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}}/api/Test');
echo $response->getBody();
setUrl('{{baseUrl}}/api/Test');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/Test');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/Test' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/Test' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/Test")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/Test"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/Test"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/Test")
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/api/Test') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/Test";
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}}/api/Test
http GET {{baseUrl}}/api/Test
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/Test
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/Test")! 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}}/api/User");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/User")
require "http/client"
url = "{{baseUrl}}/api/User"
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}}/api/User"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/User");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/User"
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/api/User HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/User")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/User"))
.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}}/api/User")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/User")
.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}}/api/User');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/api/User'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/User';
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}}/api/User',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/User")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/User',
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}}/api/User'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/User');
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}}/api/User'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/User';
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}}/api/User"]
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}}/api/User" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/User",
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}}/api/User');
echo $response->getBody();
setUrl('{{baseUrl}}/api/User');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/User');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/User' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/User' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/api/User")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/User"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/User"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/User")
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/api/User') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/User";
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}}/api/User
http GET {{baseUrl}}/api/User
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/api/User
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/User")! 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
Register a new User
{{baseUrl}}/api/User/registerUser
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/User/registerUser");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/User/registerUser")
require "http/client"
url = "{{baseUrl}}/api/User/registerUser"
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}}/api/User/registerUser"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/User/registerUser");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/User/registerUser"
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/api/User/registerUser HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/User/registerUser")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/User/registerUser"))
.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}}/api/User/registerUser")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/User/registerUser")
.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}}/api/User/registerUser');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/api/User/registerUser'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/User/registerUser';
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}}/api/User/registerUser',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/User/registerUser")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/User/registerUser',
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}}/api/User/registerUser'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/User/registerUser');
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}}/api/User/registerUser'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/User/registerUser';
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}}/api/User/registerUser"]
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}}/api/User/registerUser" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/User/registerUser",
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}}/api/User/registerUser');
echo $response->getBody();
setUrl('{{baseUrl}}/api/User/registerUser');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/User/registerUser');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/User/registerUser' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/User/registerUser' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/api/User/registerUser")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/User/registerUser"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/User/registerUser"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/User/registerUser")
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/api/User/registerUser') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/User/registerUser";
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}}/api/User/registerUser
http POST {{baseUrl}}/api/User/registerUser
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/api/User/registerUser
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/User/registerUser")! 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 an exsisting User
{{baseUrl}}/api/User/updateuser
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/User/updateuser");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/User/updateuser")
require "http/client"
url = "{{baseUrl}}/api/User/updateuser"
response = HTTP::Client.put url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/api/User/updateuser"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/User/updateuser");
var request = new RestRequest("", Method.Put);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/User/updateuser"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/api/User/updateuser HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/User/updateuser")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/User/updateuser"))
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/User/updateuser")
.put(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/User/updateuser")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/User/updateuser');
xhr.send(data);
import axios from 'axios';
const options = {method: 'PUT', url: '{{baseUrl}}/api/User/updateuser'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/User/updateuser';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/User/updateuser',
method: 'PUT',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/User/updateuser")
.put(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/User/updateuser',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'PUT', url: '{{baseUrl}}/api/User/updateuser'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/User/updateuser');
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}}/api/User/updateuser'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/User/updateuser';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/User/updateuser"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/User/updateuser" in
Client.call `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/User/updateuser",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/User/updateuser');
echo $response->getBody();
setUrl('{{baseUrl}}/api/User/updateuser');
$request->setMethod(HTTP_METH_PUT);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/User/updateuser');
$request->setRequestMethod('PUT');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/User/updateuser' -Method PUT
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/User/updateuser' -Method PUT
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("PUT", "/baseUrl/api/User/updateuser")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/User/updateuser"
response = requests.put(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/User/updateuser"
response <- VERB("PUT", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/User/updateuser")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/api/User/updateuser') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/User/updateuser";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/api/User/updateuser
http PUT {{baseUrl}}/api/User/updateuser
wget --quiet \
--method PUT \
--output-document \
- {{baseUrl}}/api/User/updateuser
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/User/updateuser")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()