1
현재 웹 서비스에 요청하기 위해 HttpGet (아파치) 메소드를 사용하고 있습니다. 나는 그것이 나에게이 오류를주고 있었다 서버를 호출 할 때 는 :httpGet에 날짜 헤더를 추가하는 방법
는 가 그럼 난 서버가 너무 GMT의 요청을 가질 필요가 있음을 알게되었다 "요청 시간과 서버 시간의 차이가 너무 큽니다" 그에 따라 헤더 (addHeader)를 추가하여 동일한 작업을 수행했습니다. 하지만 여전히 같은 문제가 있습니다.
의견/아이디어?
일부 코드 :
final String url = "ip address";
final HttpGet request = new HttpGet(url);
final ArrayList<NameValuePair> nameValues = new ArrayList<NameValuePair>();
nameValues.add(new BasicNameValuePair("Authorization", "XXXX"));
nameValues.add(new BasicNameValuePair("date", "Fri, 19 Aug 2011 22:39:13 GMT"));
for (final NameValuePair h : nameValues)
{
request.addHeader(h.getName(), h.getValue());
}
final HttpClient client = new DefaultHttpClient();
HttpResponse httpResponse;
try
{
httpResponse = client.execute(request);
responseCode = httpResponse.getStatusLine().getStatusCode();
message = httpResponse.getStatusLine().getReasonPhrase();
final HttpEntity entity = httpResponse.getEntity();
if (entity != null)
{
final InputStream instream = entity.getContent();
response = convertStreamToString(instream);
instream.close();
}
}
catch (final Exception e)
{
}
일부 코드보기 - –
"webscarab"과 같은 "디버깅 프록시"를 사용하여 헤더를 확인하고 클라이언트 - 서버 상호 작용의 로그를 덤프 할 수 있습니까? https://www.owasp.org/index.php/OWASP_WebScarab_NG_Project – andcoz
나는 이것을 해본 적이 없다 ... 그러나 링크를 사용하여 나는 클라이언트 - 서버 상호 작용의 덤프를 얻을 것이다. – Rishi