는 내가의 NameValuePair의 값으로 해시 테이블을 추가 할 :Hashtable을 NameValuePair에 어떻게 추가 할 수 있습니까? 다음과 같이
새로운 BasicNameValuePair ("CREDIT_CARD", {EXPIRATIONDATE = "
value(this is the hashtable)= {expirationDate="2013/02/18", ownerName="Jack Sparrow", typeOfCard="C2"}
또는 같은
name= credit_card
이 내 코드의 일부이며 당신은 내가 간단한의 NameValuePair을 추가 해요 방법을 볼 수 있습니다 : 사전에
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("https://example.com/register");
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("user", user));
nameValuePairs.add(new BasicNameValuePair("password", password));
post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = client.execute(post);
감사합니다!
String hash = DigestUtils.sha512Hex(json);
nameValuePairs.add(new BasicNameValuePair("credit_card", hash));
또는 직접 Java 암호화 API를 사용할 수 있습니다 :
"해시 추가"란 무엇을 의미합니까? –
여기서'해시 '에 대해 이야기하고 있습니까? – ferhan
질문이 수정되었습니다. 감사합니다. – Carlos