IRequest request = new BaseRequest(API.Config.getDomain()
+ API.CALL_DRIVER);
request.setBody("key", pushKey);
request.setBody("uid",uid);
request.setBody("phone", phone);
request.setBody("startLatitude",
new Double(startLocation.getLatitude()).toString() );
request.setBody("startLongitude",
new Double(startLocation.getLongitude()).toString() );
request.setBody("endLatitude",
new Double(endLocation.getLatitude()).toString() );
request.setBody("endLongitude",
new Double(endLocation.getLongitude()).toString() );
request.setBody("cost", new Float(cost).toString());
//这里面的参数都能打印出来,不为空,pushKey可以用,uid在一串数字前面是一串0
IRespone response = mClient.post(request, false);
OptStateResponse optStateResponse = new OptStateResponse();
if (response.getCode() == BaseBizResponse.STATE_OK){
optStateResponse = new Gson().fromJson(response.getData(),
OptStateResponse.class);
Order data = optStateResponse.getData();
Log.d(TAG, "call: order = " + response.getData());
Log.d(TAG, "call: orderid = " + data.getOrderId());
}
optStateResponse.setCode(response.getCode());
optStateResponse.setState(OptStateResponse.OPT_STATE_CREATED);
return optStateResponse;
//API的URL为:public static final String CALL_DRIVER = "/f34e28da5816433d/callDriver";