public class Test {
public static void main(String[] args) throws ClientProtocolException, IOException {
HttpClient client = new DefaultHttpClient();
JSONObject json = new JSONObject();
json.put('set_boot' : True);
json.put('synchronous': True),
json.put('filters',filterList);
List filterList = new ArrayList();
filterList.put(6005076802818994A0000000000009DD);
json.put('volumes':volumeList);
List volumeList = new ArrayList();
volumeList.add('*all');
json.add('allow_unsupported': True);
StringEntity se = new StringEntity(json.toString());
System.out.println(se);
}
}
나는 같은 JSON 쿼리로 변환 값을 추가하려고 :잘못된 문자 상수 JSON
{
'set_boot': True,
'synchronous': True,
'filters': {
'host_refs': [u '6005076802818994A0000000000009DD']
},
'volumes': ['*all'],
'allow_unsupported': True
}
그러나 이클립스 줄에 나에게 오류 잘못된 문자 상수 을주고있다
json.put('set_boot' : True);
다른 단어도 쓰려고했습니다.
json.put('set' : True);
하지만 여전히 동일한 오류가 발생합니다. 참고
json.put("set_boot", true);
json.put("synchronous", true);
(비슷한 문제가 나중에이 있습니다.)
:이 자바 될 운명 경우
'True'가 아니라'True'. ;) –
왜 '사실'이 아니라 '사실'입니까? 나는 당신이 그것들을 생성하기 바로 전에 많은 물체를 추가하고있는 것을 본다. 그건 맞지 않아. – wxyz
어떤 언어입니까? 그것은 유효한 자바가 아니기 때문에 ... –