response = requests.get(url)
print(response.text)
var request = WebRequest.Create(url);
request.Method = "GET";
var webStream = request.GetResponse().GetResponseStream();
var reader = new System.IO.StreamReader(webStream);
var data = reader.ReadToEnd();
Console.Write(data);
var webStream = request.GetResponse().GetResponseStream();
var reader = new System.IO.StreamReader(webStream);
// получаю переменную data, которая является строкой
var data = reader.ReadToEnd();
// при помощи JArray.Parse(data) прохожусь циклом
var jarray = JArray.Parse(data);
foreach (var i in jarray)
{
Console.Write(i["StartEducation"]); // значения в таком формате: "2022.11.08" или ""
Console.Write(i["EndEducation"]); // значения в таком формате: "2022.11.08" или ""
}
[
{
"DateCreate": "vsavadsvsadv",
"CompanyName": "vsdvsadvsadavs",
"StoreID": "",
"SNILS": "vsadvsav",
"Association": "vsdavasdv",
"EducationType": "vsdavsadv",
"Specialty": "vsdavsavdas",
"StartEducation": "",
"EndEducation": "1993.11.24",
"LastSertificationDate": "1993.11.24",
"Reason": ""
},
{
"DateCreate": "2022.11.20",
"CompanyName": "fas",
"StoreID": "",
"SNILS": "fsasas",
"Association": "safsafsa",
"EducationType": "fasfa",
"Specialty": "fvsda",
"StartEducation": "",
"EndEducation": "",
"LastSertificationDate": "2001.11.24",
"Reason": ""
},
/// и так далее
]
Console.WriteLine(DateTime.Parse("0022.12.10")
12/10/0022 12:00:00 AM
0022-10-12 // такой напримре
0022-10-12 00:00:00.000// или такой например
url_dimensions = ('ym:i:appID', 'ym:i:publisher', 'ym:i:campaign', 'ym:i:date', 'ym:i:regionCountry', 'ym:i:regionArea')
url_metrics = 'ym:i:installDevices'
url_headers = {"Authorization": "OAuth fjsfnlkdsknsadlknlkndsaffsdknsfksdnsd"}
url_param = dict(
date1 = '2022-12-01',
date2 = '2022-12-12',
dimensions = url_dimensions,
metrics = url_metrics,
lang = 'ru',
ids = '3412066',
accuracy = 1,
limit = 100000
)
using System;
using System.Net.Http;
class HelloWorld {
static void Main() {
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://api.appmetrica.yandex.ru/test/test/test");
client.DefaultRequestHeaders
.Authorization
.Add(new MediaTypeWithQualityHeaderValue("OAuth fjsfnlkdsknsadfsafsadfsalknlkndsaffsdknsfksdnsd"));
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "");
request.Content = new StringContent("", Encoding.UTF8, "application/json");//CONTENT-TYPE header
client.SendAsync(request)
.ContinueWith(responseTask =>
{
Console.WriteLine(responseTask.Result);
});
}
}
url_dimensions = ('ym:i:appID', 'ym:i:publisher', 'ym:i:campaign', 'ym:i:date', 'ym:i:regionCountry', 'ym:i:regionArea')
url_metrics = 'ym:i:installDevices'
url_headers = {"Authorization": "OAuth fjsfnlkdsknsadlknlkndsaffsdknsfksdnsd"}
url_param = dict(
date1 = '2022-12-01',
date2 = '2022-12-12',
dimensions = url_dimensions,
metrics = url_metrics,
lang = 'ru',
ids = '3412066',
accuracy = 1,
limit = 100000
)
using System;
using System.Net.Http;
class HelloWorld {
static void Main() {
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://api.appmetrica.yandex.ru/test/test/test");
client.DefaultRequestHeaders
.Authorization
.Add(new MediaTypeWithQualityHeaderValue("OAuth fjsfnlkdsknsadfsafsadfsalknlkndsaffsdknsfksdnsd"));
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "");
request.Content = new StringContent("", Encoding.UTF8, "application/json");//CONTENT-TYPE header
client.SendAsync(request)
.ContinueWith(responseTask =>
{
Console.WriteLine(responseTask.Result);
});
}
}