我正在使用Retrofit Lib.
我的代码是
public class TestPostData {
final String username;
final String password;
TestPostData(String username, String password) {
this.username = username;
this.password = password;
}
}
Run Code Online (Sandbox Code Playgroud)
和界面是
interface Test {
@POST("/post.php")
void testMethod(@Body TestPostData postbody,@Query("qName") String qName,Callback<Response> callback);
}
Run Code Online (Sandbox Code Playgroud)
休息适配器
RestAdapter restAdapter = new RestAdapter.Builder()
.setEndpoint(TEST_URL)
.setLogLevel(RestAdapter.LogLevel.FULL)
.build();
Run Code Online (Sandbox Code Playgroud)
并称之为
testObj.testMethod(new TestPostData("myusername", "mypassword"),"myname",new Callback<Response>() { ..............
Run Code Online (Sandbox Code Playgroud)
在服务器端,我得到$ _POST数组为空.如何在服务器端获取用户名和密码值.我得到了名字的价值.
我想我们可以建立它.但我在Android Studio上构建它时遇到错误.首先我下载Android Studio和NDK.然后将Android Studio和NDK的PATH添加到PATH变量.我跑的时候
./check_tools.sh
Run Code Online (Sandbox Code Playgroud)
我得到了输出
Could not find automake. Please install it.
Could not find autoconf. Please install it.
Could not find pkg-config. Please install it.
Could not find ant. Please install it.
Could not find yasm. Please install it.
Could not find wget. Please install it.
Could not find libtoolize. Please install libtool.
Invalid version of nasm: your version does not support elf32 output format. If you have installed nasm, please check that your PATH env variable is …Run Code Online (Sandbox Code Playgroud)