我正在使用带有POST的自定义api的azure web服务,如下所示:
mClient = new MobileServiceClient(
"Your web service",
"niHVXXnRXOGVGnvEMvImMIdgnraflH99",
this).withFilter(new ProgressFilter());
loadData();
private void loadData() {
ArrayList<Pair<String ,String>> bodyParams = new ArrayList<Pair<String, String>>();
bodyParams.add(new Pair<String, String>("username","xyz@gmail.com"));
bodyParams.add(new Pair<String, String>("password","qwertyuiop"));
bodyParams.add(new Pair<String, String>("displayname","your name"));
bodyParams.add(new Pair<String, String>("phonenumber","9745893297"));
bodyParams.add(new Pair<String, String>("phoneIMEI","356938035643809"));
bodyParams.add(new Pair<String, String>("isindividualgroup","false"));
bodyParams.add(new Pair<String, String>("firmName",""));
bodyParams.add(new Pair<String, String>("address1",""));
bodyParams.add(new Pair<String, String>("phone1",""));
bodyParams.add(new Pair<String, String>("city","Pune"));
bodyParams.add(new Pair<String, String>("state","Maharashtra"));
bodyParams.add(new Pair<String, String>("countryId","2"));
bodyParams.add(new Pair<String, String>("zipCode",""));
bodyParams.add(new Pair<String, String>("offeringiD","1004bca1-d45f-4da5-8608-199f380b6725"));
bodyParams.add(new Pair<String, String>("numberOfLicense","0"));
mClient.invokeApi("CustomRegistration", null, "POST", null, bodyParams, new ServiceFilterResponseCallback() {
@Override
public void onResponse(ServiceFilterResponse response, Exception exception) {
if(exception!= null)
{
exception.printStackTrace();
}
else {
System.out.println("RESPONSE : " + response.getContent());
}
}
});
}
当我在设备上运行它时会发出如下错误:
com.microsoft.windowsazure.mobileservices.MobileServiceException: {"$id":"1","message":"An error has occurred."}
任何人都可以告诉我这是什么问题吗? 我非常确定URL是正确的,参数是正确的,但没有得到响应。 请帮帮我。