// Входные данные
$url = "https://data.tronk.info/bldr.ashx";
$request_params = array(
"key" => "867983b5-d66d-44d7-b440-5bd00b0b8203",
"command" => "getlist",
"pricestart" => 1,
"priceend" => 9999,
"source" => ".2.16.17.18.",
"type" => ".1.2.4.",
"region" => "Москва",
"pagesize" => 20,
"countview" => 300
);
$get_params = http_build_query($request_params);
// Запрос к серверу
$response = file_get_contents($url."?".$get_params);
// Преобразование ответа
$result = json_decode($response);
import requests
url = "https://data.tronk.info/bldr.ashx"
# входные данные
params = {
"key": "867983b5-d66d-44d7-b440-5bd00b0b8203",
"command": "getlist",
"pricestart": 1,
"priceend": 9999,
"source": ".2.16.17.18.",
"type": ".1.2.4.",
"region": "Москва",
# Необязательные
"pagesize": 20,
"countview": 300
}
# отправка запроса
response = requests.post(
url=url,
params=params,
)
# преобразование ответа к словарю
data = response.json()
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
string end_point = "https://data.tronk.info/bldr.ashx";
Dictionary dict_params = new()
{
{ "key", "867983b5-d66d-44d7-b440-5bd00b0b8203" },
{ "command", "getlist" },
{ "pricestart", "1" },
{ "priceend", "9999" },
{ "source", ".2.16.17.18." },
{ "type", ".1.2.4." },
{ "region", "Москва" },
{ "pagesize", "20" },
{ "countciew", "300" }
};
string url_params = string.Join("&", dict_params.Select(kvp => $"{kvp.Key}={kvp.Value}"));
string url = $"{end_point}?{url_params}";
HttpClient client = new();
string response_body = await client.GetAsync(url).Result.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject(response_body);
}
}
// Входные данные
$url = "https://data.tronk.info/bldr.ashx";
$request_params = array(
"key" => "867983b5-d66d-44d7-b440-5bd00b0b8203",
"command" => "getdata",
"listid" => "1,2,3"
);
$get_params = http_build_query($request_params);
// Запрос к серверу
$response = file_get_contents($url."?".$get_params);
// Преобразование ответа
$result = json_decode($response);
import requests
url = "https://data.tronk.info/bldr.ashx"
# входные данные
params = {
"key": "867983b5-d66d-44d7-b440-5bd00b0b8203",
"command": "getdata",
"listid": "1,2,3"
}
# отправка запроса
response = requests.post(
url=url,
params=params,
)
# преобразование ответа к словарю
data = response.json()
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
string end_point = "https://data.tronk.info/bldr.ashx";
Dictionary dict_params = new()
{
{ "key", "867983b5-d66d-44d7-b440-5bd00b0b8203" },
{ "command", "getdata" },
{ "listid", "1,2,3" }
};
string url_params = string.Join("&", dict_params.Select(kvp => $"{kvp.Key}={kvp.Value}"));
string url = $"{end_point}?{url_params}";
HttpClient client = new();
string response_body = await client.GetAsync(url).Result.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject(response_body);
}
}