Commit f3af22b8 authored by Valentin Skripnikov's avatar Valentin Skripnikov

-

parent 2416d912
......@@ -386,26 +386,30 @@ REST API ARTA Synergy доступно только авторизованным
Пример кода на JAVA:
.. code-block:: java
:emphasize-lines: 2
:emphasize-lines: 5
HttpResponse<String> response = Unirest.post("https://demo.arta.kz/Synergy/rest/api/report/do?reportID=daa64ab2-1a79-4ea2-9c24-372e35d9da3e&fileName=report.pdf")
.header("authorization", "Basic QWRtaW5pc3RyYXRvcjoxMjM0NTY=")
.header("cache-control", "no-cache")
String login = "Administrator";
String password = "123456";
HttpResponse<String> response = Unirest.get("http://demo.arta.kz/Synergy/rest/api/admin/db/current_version")
.header("authorization", Base64.getEncoder().encodeToString((login + ":" + password).getBytes("UTF‌​-8")))
.asString();
Пример кода на JavaScript (jQuery):
.. code-block:: js
:emphasize-lines: 7
:emphasize-lines: 10
var login = "Administrator";
var password = "123456";
var settings = {
"async": true,
"crossDomain": true,
"url": "https://demo.arta.kz/Synergy/rest/api/report/do?reportID=daa64ab2-1a79-4ea2-9c24-372e35d9da3e&fileName=report.pdf",
"method": "POST",
"url": "http://demo.arta.kz/Synergy/rest/api/admin/db/current_version",
"method": "GET",
"headers": {
"authorization": "Basic QWRtaW5pc3RyYXRvcjoxMjM0NTY=",
"cache-control": "no-cache"
"authorization": ("Basic " + btoa(login + ":" + password))
}
}
......@@ -416,22 +420,19 @@ REST API ARTA Synergy доступно только авторизованным
Пример кода на PHP:
.. code-block:: php
:emphasize-lines: 14
:emphasize-lines: 8
<?php
$request = new HttpRequest();
$request->setUrl('https://demo.arta.kz/Synergy/rest/api/report/do');
$request->setMethod(HTTP_METH_POST);
$login = "Administrator";
$password = "123456"
$request->setQueryData(array(
'reportID' => 'daa64ab2-1a79-4ea2-9c24-372e35d9da3e',
'fileName' => 'report.pdf'
));
$request = new HttpRequest();
$request->setUrl('http://demo.arta.kz/Synergy/rest/api/admin/db/current_version');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'authorization' => 'Basic QWRtaW5pc3RyYXRvcjoxMjM0NTY='
'authorization' => "Basic " . base64_encode("$login:$password")
));
try {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment