this 웹 서비스에 데이터를 게시하려하지만이 권한을 얻을 수없는 것 같습니다! 그래서 임씨는 서버에 json을 게시하려하지만이를 수행하는 방법을 모른다.서버로 데이터를 보내고 응답을 처리하십시오 - Android
콘텐츠 형식 : 응용 프로그램/JSON HTTPMethod : POST의 HTTPBody : { "CouponVerificationCode": "594952223490", "apiKey에": "zFyWQDYUKXQQpvG86snPD1OSslr7Q6DGEGbQ1f7P2YeTxB56y"나는 JSON의 responce을 얻기 위해이 예제 JSON을 보낼 필요 "토큰": "_ 2_jx1YFvTZGGLNtJBoDW3gDZmNNAGpTWzT7dC6GrNAIkhhX9PWv75b776gq1ZO_2_SxMJjq8_2_kaDMyxX59HczOyaw =="}
대신 내가 html로 responce을 얻을 json으로 responce을 가져 오는. 누군가이 문제를 해결할 수 있도록 도와 줄 수 있습니까?
public static String makeRequest(String path) throws Exception {
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httpost = new HttpPost(path);
JSONObject holder = new JSONObject();
// holder.accumulate(name, value)
String test = "{\"ApiKey\":\"somekey\","
+ "\"OperativeSystem\":\"0\","
+ "\"AppVersion\":\"1\","
+ "\"WebServiceVersion\":\"1\"}";
StringEntity se = new StringEntity(test);
Log.v("--", test);
httpost.setEntity(se);
httpost.setHeader("Accept", "application/json");
httpost.setHeader("Content-type", "application/json");
ResponseHandler responseHandler = new BasicResponseHandler();
String response = httpclient.execute(httpost, responseHandler);
// HttpEntity entity = response.getEntity();
Log.v("--", response);
return response;
}
당신이 지금 답을 얻고 무엇 당신은 HTML – geekCode
로 변환 구문 분석 할 필요가 .. ?? : 여기 내 작업 코드는 –
를 JSON되지 않는 responce을 @geekCode responce 문자열 – geekCode