Home > Back-end >  For help, how httpClient calls to the remote interface map <String, byte []> type data
For help, how httpClient calls to the remote interface map <String, byte []> type data

Time:11-09

My little white, use httpClient invoke the remote mail system, there are several parameters of array type, there is a parameter map

CodePudding user response:

A Post request

CodePudding user response:

Byte [] is a file stream is a file attachment to flow in

CodePudding user response:

refer to the second floor qkniit response:
byte [] is a file stream is a file attachment to flow in

Bosses, do not know with what method can say about it, the mail system interface document parameters to map//declare to store the set of parameter List
List Form=new ArrayList (a);
//traverse map, set the parameters to a list
For (String key: params keySet ()) {
Form. The add (new BasicNameValuePair (key, params. Get (key). The toString ()));

}

//create form form object
UrlEncodedFormEntity entity=new UrlEncodedFormEntity (form, "utf-8");
//set the form object to the httpPost
HttpPost. SetEntity (entity);
  • Related