7_API REFERENCE MANUAL
OJMAR 181
7.6.2.1.2
POST REQUEST
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://...");
$curl_post_data = array(
'data1' => 'xxxxxx',
'data2' => 'xxxxx'
);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
$curl_response = curl_exec($curl);
curl_close($curl);
$decoded = json_decode($curl_response);
7.6.2.1.3
POST JSON STRING
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://...");
$jsonString = json_encode($data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonString);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:
application/json'));
$curl_response = curl_exec($curl);
curl_close($curl);
$decoded = json_decode($curl_response);
7.6.2.2
Java
This document shows how to create a RESTful JAVA client with Java build-in HTTP
client library. We will use "java.net.URL" and "java.net.HttpURLConnection".
7.6.2.2.1
GET
URL url = new URL("http://...");
HttpURLConnection
conn
=
(HttpURLConnection)
url.openConnection(); conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
if (conn.getResponseCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ conn.getResponseCode());
}
Summary of Contents for Nexo NLX1
Page 1: ...E S P INSTRUCTIONS MANUAL VERSION 2 0 NEXO NLX1 SYSTEM...
Page 2: ......
Page 3: ...INSTRUCTIONS MANUAL VERSION 1 0 NEXO NLX1 SYSTEM...
Page 7: ...CONTENTSOJMAR 7 PAGE LEFT BLANK INTENTIONALLY...
Page 39: ...2_MANUAL DE INSTALACI N OJMAR 39 PAGE LEFT BLANK INTENTIONALLY...
Page 57: ...3_PUESTA EN MARCHA OJMAR 57 PAGE LEFT BLANK INTENTIONALLY...
Page 62: ...5_MANUAL DE MANTENIMIENTO 1 2 3 User key master or service 4...
Page 70: ...5_MANUAL DE MANTENIMIENTO...
Page 74: ...5_MANUAL DE MANTENIMIENTO PAGE LEFT BLANK INTENTIONALLY...
Page 150: ...7_API REFERENCE MANUAL options BT group 1 range_from 1 range_to 100...
Page 184: ...7_API REFERENCE MANUAL PAGE LEFT BLANK INTENTIONALLY...
Page 186: ...7_API REFERENCE MANUAL Option b...
Page 187: ...7_API REFERENCE MANUAL OJMAR 187 Option c INSTALLING ONE ROUTER PER 50 LOCKS IS RECOMMENDED...
Page 188: ...7_API REFERENCE MANUAL...