|
|
|
Вопрос по curl
|
|||
|---|---|---|---|
|
#18+
Всем привет. Возник маленький вопрос по curl'у. Я пытаюсь получить данные (сперва делаю авторизацию) и у меня не получается получить ответ от сервера, который, кстати, должен выдавать xml. curl = curl_init('тут урл'); $user = "user"; $password = "pass"; curl_setopt($curl,CURLOPT_HEADER,1); curl_setopt($curl, CURLOPT_FAILONERROR, 1); curl_setopt($curl, CURLOPT_AUTOREFERER, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_REFERER, 1); $uagent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"; curl_setopt($curl, CURLOPT_USERAGENT, $uagent); curl_setopt($curl, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'].'/cookie.txt'); $res = curl_exec($curl); var_dump($res); И мне выводит: string(1338) "HTTP/1.1 200 OK Content-Type: application/xml Content-Disposition: filename="results.xml" Pragma: No-cache Cache-Control: no-cache Content-Language: en-US Set-Cookie: LtpaToken2=****; Path=/ Set-Cookie: LtpaToken=****; Path=/ Date: Wed, 14 Mar 2012 19:25:22 GMT Server: WebSphere Application Server/6.1 Expires: Thu, 01 Dec 1994 16:00:00 GMT Content-Length: 0 " Не могу понять почему не выводится контент. Content-Type: application/xml - как я понимаю мы получаем xmlник. Почему Content-Length: 0 - т.е. пусто и почему Content-Disposition: filename="results.xml" - значит что я получил пустой xmlник? Зарание спасибо за ответы. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.03.2012, 23:37:37 |
|
||
|
Вопрос по curl
|
|||
|---|---|---|---|
|
#18+
imbagw, // опции защищенного соединения curl_setopt($ch, CURLOPT_HEADER, true); // Display headers curl_setopt($ch, CURLOPT_VERBOSE, true); // Display communication with server curl_setopt($ch, CURLOPT_URL, $c_url); может всё-таки url в опции прописать? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.04.2012, 18:02:23 |
|
||
|
|

start [/forum/topic.php?fid=23&msg=37735063&tid=1465328]: |
0ms |
get settings: |
5ms |
get forum list: |
15ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
173ms |
get topic data: |
8ms |
get forum data: |
1ms |
get page messages: |
30ms |
get tp. blocked users: |
1ms |
| others: | 192ms |
| total: | 429ms |

| 0 / 0 |
