나는 이런 상태입니다. 항상 평범한 소켓을 사용하는 C/C++ 프로그램에서 HTTP GET 쿼리를 만들 때 나는 301 Moved Permanent를 얻는다. 일반적으로 libcURL을 사용 하겠지만이 경우 다른 라이브러리를 추가하고 싶지 않습니다. 하나의 고정 서버에서 하나의 플랫 ID 파일을 다운로드하면됩니다.C++ HTTP는 항상 소켓을 사용하여 301을 사용합니다.
이 내 현재 쿼리입니다 : 나는 모든 것을 시도하고, 모든 것이 그냥 재미 메시지와 함께 대답됩니다
GET /game/getversion.jsp?user=nightcracker&password=yeahright&version=12 HTTP/1.1\r\n
Connection: close\r\n
Host: www.minecraft.net\r\n
Accept-Encoding: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n
\r\n
:
HTTP/1.1 301 Moved Permanently
Server: nginx/0.6.32
Date: Tue, 15 Mar 2011 02:18:11 GMT
Content-Type: text/html
Content-Length: 185
Connection: close
Location: http://www.minecraft.net/game/getversion.jsp?user=nightcracker&password=yeahright&version=12
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/0.6.32</center>
</body>
</html>
내가 전에이 문제가 기억하고 내가 전에 ragequitted. 이제이 망할 놈을 고치고 싶습니다. 그래서 말해 봐요. 왜 모든 HTTP 쿼리가 항상 301을 돌려 주죠?
Accept-Encoding을 Accept로 변경하면 올바르지 않지만 아무 것도 수정하지 않습니다. – orlp