1

向 localhost 上的 Web 服务发送请求时收到 HTTP 404:

http://localhost/my-ws/Test

在 Firefox 中,我得到一个 HTTP 200 OK:

GET /my-ws/Test HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cache-Control: max-age=0

在歌剧中:

GET /my-ws/Test HTTP/1.1 
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; en; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 12.00
Host:   localhost
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Language:    en,de-DE;q=0.9,de;q=0.8
Accept-Encoding:    gzip, deflate
Pragma: no-cache
Cache-Control:  no-cache
Connection: Keep-Alive

这里有什么问题?为 RCurl 提供哪些参数以获得与 Firefox 中相同的结果?

4

0 回答 0