Java Ok Http
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{ \r\n DATOS INMUEBLE EN FORMATO JSON\r\n}");
Request request = new Request.Builder()
.url("https://api.inmofactory.com/api/property")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Inmofactory-Api-Key", "37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx")
.addHeader("Cache-Control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Java Unirest
HttpResponse response = Unirest.post("https://api.inmofactory.com/api/property")
.header("Content-Type", "application/json")
.header("Inmofactory-Api-Key", "37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx")
.header("Cache-Control", "no-cache")
.body("{ \r\n DATOS INMUEBLE EN FORMATO JSON\r\n}")
.asString();
C# RestSharp
var client = new RestClient("https://api.inmofactory.com/api/property");
var request = new RestRequest(Method.POST);
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Inmofactory-Api-Key", "37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{ \r\n DATOS INMUEBLE EN FORMATO JSON\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
PHP HttpRequest
setUrl('https://api.inmofactory.com/api/property');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Inmofactory-Api-Key' => '37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx',
'Content-Type' => 'application/json'
));
$request->setBody('{
DATOS INMUEBLE EN FORMATO JSON
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
PHP pecl_http
append('{
DATOS INMUEBLE EN FORMATO JSON
}');
$request->setRequestUrl('https://api.inmofactory.com/api/property');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Inmofactory-Api-Key' => '37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx',
'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
Javascript JQuery AJAX
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.inmofactory.com/api/property",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Inmofactory-Api-Key": "37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx",
"Cache-Control": "no-cache"
},
"data": "{ \r\n DATOS INMUEBLE EN FORMATO JSON\r\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Javascript XHR
var data = "{ \r\n DATOS INMUEBLE EN FORMATO JSON\r\n}";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.inmofactory.com/api/property");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Inmofactory-Api-Key", "37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx");
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.send(data);
Node js Native
var http = require("https");
var options = {
"method": "POST",
"hostname": [
"api",
"inmofactory",
"com"
],
"path": [
"api",
"property"
],
"headers": {
"Content-Type": "application/json",
"Inmofactory-Api-Key": "37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx",
"Cache-Control": "no-cache"
}
};
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("{ \r\n DATOS INMUEBLE EN FORMATO JSON\r\n}");
req.end();
Node js Request
var request = require("request");
var options = { method: 'POST',
url: 'https://api.inmofactory.com/api/property',
headers:
{ 'Cache-Control': 'no-cache',
'Inmofactory-Api-Key': '37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx',
'Content-Type': 'application/json' },
body: '{ \r\n DATOS INMUEBLE EN FORMATO JSON\r\n}' };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Node js Unirest
var unirest = require("unirest");
var req = unirest("POST", "https://api.inmofactory.com/api/property");
req.headers({
"Cache-Control": "no-cache",
"Inmofactory-Api-Key": "37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx",
"Content-Type": "application/json"
});
req.send("{ \r\n DATOS INMUEBLE EN FORMATO JSON\r\n}");
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
cURL
curl -X POST \
https://api.inmofactory.com/api/property \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'Inmofactory-Api-Key: 37d14b4e9a7a4f0fa4f959dbef3e23f69bb29abc6bdc4787809cfxxxxxxxxxxxxxx' \
-d '{
DATOS INMUEBLE EN FORMATO JSON
}'