Reputation: 71
I am using Retrofit Lib.
My code is
public class TestPostData {
final String username;
final String password;
TestPostData(String username, String password) {
this.username = username;
this.password = password;
}
}
and interface is
interface Test {
@POST("/post.php")
void testMethod(@Body TestPostData postbody,@Query("qName") String qName,Callback<Response> callback);
}
Rest Adapter
RestAdapter restAdapter = new RestAdapter.Builder()
.setEndpoint(TEST_URL)
.setLogLevel(RestAdapter.LogLevel.FULL)
.build();
and call it as
testObj.testMethod(new TestPostData("myusername", "mypassword"),"myname",new Callback<Response>() { ..............
at the server side i get $_POST array as empty. How to get username and password value at server side. I get the name value.
Upvotes: 2
Views: 1964