List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("Provider", "UY"));
nvps.add(new BasicNameValuePair("AccessToken ", "sdfl;kjsdg"));
httpPost.setEntity(new UrlEncodedFormEntity(nvps));
このようにhttpリクエストにパラメータを追加しています。しかし、java.util.Dictionary オブジェクトである別のエンティティを追加するにはどうすればよいですか。
Dictionary<String, String) dict = new Dictionary();
//add values to dict
httpPost.setEntity(dict);
動作しないでしょう。どうするのが正しい方法ですか?
更新:
これは私のサーバーが期待しているものです
Dictionary ExtraData
string Provider
string AccessToken
として送信できる 2 つの文字列値List<NameValuePair> nvps
。それをエンティティに設定します。しかし、最初のものはどうですか?
複数のエンティティを httpRequest に設定できないことを読んでください