0
發佈的數據我是新使用改造2
我可以得到的數據,但我不能用這種方式發佈的數據
我得到的數據如何利用改造2從機器人
我ApiClient
類是
public class ApiClient {
public static final String BASE_URL = "http://test.com/test/";
private static Retrofit retrofit = null;
public static Retrofit getClient() {
if (retrofit==null) {
retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
}
return retrofit;
}
}
我ApiInterface
接口
public interface ApiInterface {
@GET("test1.php")
Call<data1> getMethod1();
@GET("test2.php")
Call<data2> getMethod2();
}
在我MainActivity.class
是
ApiInterface apiService =
ApiClient.getClient().create(ApiInterface.class);
Call<data1> call = apiService.getdata1();
call.enqueue(new Callback<data1>() {
@Override
public void onResponse(Call<data1> call, Response<data1> response) {
data1List = response.body().getdata1data();
GoToMain();
}
@Override
public void onFailure(Call<data1> call, Throwable t) {
});
我怎樣才能發佈此數據
URL : http://http://test.com/test/FeedBack.php
Request Sample : POST : /FeedBack.php
Request parameter name : data
Request parameter value :
{
"dd":{
"nn":"qwexcvsd",
"mm":1,
"gg":1
},
"ss":{
"ss_id":1
},
"contactcard":{
"address":"asd",
"phone1":"123123",
"phone2":"",
"phone3":"",
"phone4":"",
"email":"",
"comment":"",
"gg_id":1,
"ii":"1"
},
"ff":{
"dd":"asdas",
"user_id":11,
"AccessToken":"eb5e72cbeb94bda0e5c43ab8f4a23af6",
"wwee:2,
"asd":"2014-07-18 04:46:01"
}
}
請任何幫助,因爲我搜索了很多,沒有達到什麼
範例,Dd和Ff對您的答案是否重要? –
@mohamed zarei 必填參數缺少:數據 –
@代碼學徒不,我只是用他的JSON創建了一個模型。 –