【发布时间】:2014-11-11 23:27:25
【问题描述】:
请帮助我!我通过电子邮件将此帖子发送到服务器以进行授权,但服务器已回复
"error":"Wrong input parameters"
我知道 items 是真的!prolem 不在 items 中!
public String RegistrationByEmail(String email, String username, String password) throws IOException {
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy
= new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://speechyard.com/api/register");
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(3);
nameValuePairs.add(new BasicNameValuePair("email", email));
nameValuePairs.add(new BasicNameValuePair("username", username));
nameValuePairs.add(new BasicNameValuePair("pssword", password));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
Id_Token_from_website2 = responseHandler(response);
Log.v(TAG, "Id_Token_from_website : " + Id_Token_from_website2);
} catch (ClientProtocolException e) {
} catch (IOException e) {
}
return Id_Token_from_website2;
}
【问题讨论】:
标签: http-post androidhttpclient