curl -X POST \
--url 'https://hook.ubeac.io/12345678' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-pretty-print: 2' \
--cookie 'foo=bar; bar=baz' \
--data '{"foo": "bar"}'
wget
--method POST \
--header 'cookie: foo=bar; bar=baz' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-pretty-print: 2' \
--body-data '{"foo": "bar"}' \
--output-document \
- 'https://hook.ubeac.io/12345678'
echo '{"foo": "bar"}' | http POST 'https://hook.ubeac.io/12345678' accept:application/json content-type:application/json cookie:'foo=bar; bar=baz' x-pretty-print:2
import requests
url = "https://hook.ubeac.io/12345678"
querystring = {"foo":["bar","baz"]}
payload = "{\"foo\": \"bar\"}"
headers = {
'cookie': "foo=bar; bar=baz",
'accept': "application/json",
'content-type': "application/json",
'x-pretty-print': "2"
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
require 'net/http'
require 'net/https'
require 'json'
uri = URI.parse("https://hook.ubeac.io/12345678")
https = Net::HTTP.new(uri.host,uri.port)
https.use_ssl = true
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = 'application/json'
req.body = {'foo': 'bar'}.to_json
res = https.request(req)
puts res.body
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl
CURLcode res
curl_global_init(CURL_GLOBAL_ALL)
curl = curl_easy_init();
if(curl) {
struct curl_slist *headers = NULL;
curl_easy_setopt(curl, CURLOPT_URL, "https://hook.ubeac.io/12345678")
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "accept: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_COOKIE, "foo=bar; bar=baz")
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"foo\": \"bar\"}");
res = curl_easy_perform(curl);
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s", curl_easy_strerror(res))
curl_easy_cleanup(curl)
}
curl_global_cleanup()
return 0;
}
var client = new RestClient("https://hook.ubeac.io/12345678");
var request = new RestRequest(Method.POST);
request.AddHeader("x-pretty-print", "2");
request.AddHeader("content-type", "application/json");
request.AddHeader("accept", "application/json");
request.AddCookie("foo", "bar");
request.AddCookie("bar", "baz");
request.AddParameter("application/json", "{\"foo\": \"bar\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var settings = {
"async": true,
"crossDomain": true,
"url": "https://hook.ubeac.io/12345678",
"method": "POST",
"headers": {
"accept": "application/json",
"content-type": "application/json",
:
},
"processData": false,
"data": "{\"foo\": \"bar\"}"
}
$.ajax(settings).done(function (response) {
console.log(response);
})
var data = JSON.stringify({
"foo": "bar"
})
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
})
xhr.open("POST", "https://hook.ubeac.io/12345678");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("x-pretty-print", "2");
xhr.send(data);
var http = require('https');
var options = {
'method': 'POST',
'hostname': 'hook.ubeac.io',
'port': null,
'path': '/12345678?foo=bar&foo=baz',
'headers': {
'cookie': 'foo=bar
'accept': 'application/json',
'content-type': 'application/json',
'x-pretty-print': '2'
}
}
var req = http.request(options, function (res) {
var chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk)
})
res.on('end', function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
})
})
req.write(JSON.stringify({foo: 'bar'}));
req.end()
var request = require("request");
var jar = request.jar();
var options = { method: 'POST',
url: 'https://hook.ubeac.io/12345678',
qs: { foo: [ 'bar', 'baz' ] },
headers:
{ 'x-pretty-print': '2',
'content-type': 'application/json',
accept: 'application/json' },
body: { foo: 'bar' },
json: true,
jar: 'JAR' };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
})
var unirest = require("unirest");
unirest.post('https://hook.ubeac.io/12345678')
.headers({'Accept': 'application/json', 'Content-Type': 'application/json'})
.send({"foo": "bar"})
.end(function (response) {
console.log(response.body);
})