http ポストに TCP クライアントを使用する。例外とは異なる結果が得られます。いいえ HTTP 200 OK...
これが私のリクエストです:
GET / HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: de-DE
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
Host:www.mywebsite.com
Connection: Keep-Alive
Cache-Control: max-age=0
ここに私の応答があります:
HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Location: http://somewhere.com (url changed)
Content-Length: 0
Date: Fri, 03 Aug 2012 10:38:14 GMT
「場所」にリダイレクトするように指示されます。次のリクエストは、 www.mywebsite.com を参照してhttp://somewhere.comへの GET である必要があります。
もう 1 つのシナリオは、https リンクです。多くの場合、HostEntry が返す IP とはまったく異なる IP です。IPを取得するには?C# で簡単な方法はありますか?