This repository has been archived by the owner on Jul 20, 2020. It is now read-only.
CW section #28
Comments
See 504 too. May be incorrect cache saved?( |
Works for me. function getResp($parr) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://cw1.worldoftanks.eu".$parr);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_HTTPHEADER,
array(
'Accept: application/json, text/javascript, text/html, */*',
'X-Requested-With: XMLHttpRequest'
)
);
curl_setopt($ch, CURLOPT_REFERER, "http://worldoftanks.eu/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$c_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
if (curl_getinfo($ch, CURLINFO_CONTENT_TYPE) == 'image/jpeg') {
$response = array();
$response['request_data']['error_message'] = w2u('Site returned JPEG, Maintanace maybe?');
$response = json_encode($response);
}
// echo $c_type;
curl_close($ch);
return $response;
}
print_r( getResp('/clanwars/maps/provinces/regions/1/?ct=json') ); Not working without proper REFERER |
Yup, thx, now they change little thing on cw code, and without referer or bad referer they show just a timeout. |
Well, I always send referer and this header to any requests, so I didnot faced such issues atall :) Just in case... |
Do you know how to impliment it in c# ? I tryed :
But I get Timeout 503. Any idea ? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Anyone else can reach the cw section? ( http://cw1.worldoftanks.eu/clanwars/maps/provinces/regions/1/?ct=json ) Ive got bad gateway / timeout as answare.
The text was updated successfully, but these errors were encountered: