vk

Deserialize JSON when type can be different

孤街醉人 提交于 2019-11-27 08:15:47
问题 I`m working with VK API. Sometimes server can return empty array instead of object, for example: personal: [] //when it is empty or personal: { religion: 'Нет', smoking: 1, alcohol: 4 } //when not empty. I`m deserializing most of json with JsonConvert.DeserializeObject, and this part of json with MainObject = ((MainObject["response"].GetObject())["user"].GetObject())["personal"].GetObject(); try { Convert.ToByte(MainObject["political"].GetNumber(); } catch {} But it makes app works slowly

Curl error 60, SSL certificate issue: self signed certificate in certificate chain

扶醉桌前 提交于 2019-11-26 12:56:13
I try to send curl request with my correct APP_ID, APP_SECRET etc. to the https://oauth.vk.com/access_token?client_id=APP_ID&client_secret=APP_SECRET&code=7a6fa4dff77a228eeda56603b8f53806c883f011c40b72630bb50df056f6479e52a&redirect_uri=REDIRECT_URI I need to get access_token from it, but get a FALSE and curl_error() print next message otherwise: 60: SSL certificate problem: self signed certificate in certificate chain My code is: // create curl resource $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, $url); //return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER,

Curl error 60, SSL certificate issue: self signed certificate in certificate chain

夙愿已清 提交于 2019-11-26 05:52:18
问题 I try to send curl request with my correct APP_ID, APP_SECRET etc. to the https://oauth.vk.com/access_token?client_id=APP_ID&client_secret=APP_SECRET&code=7a6fa4dff77a228eeda56603b8f53806c883f011c40b72630bb50df056f6479e52a&redirect_uri=REDIRECT_URI I need to get access_token from it, but get a FALSE and curl_error() print next message otherwise: 60: SSL certificate problem: self signed certificate in certificate chain My code is: // create curl resource $ch = curl_init(); // set url curl