我想知道哪个更好/更快:
我正在寻找主题来显示完整路径+ git(分支名称+未提交的更改+添加的文件).没找到任何.这样的事情:
/full/path/to/repo (master *+)
Run Code Online (Sandbox Code Playgroud)
我会喜欢推荐一个/如何编辑现有的建议(我目前正在使用哥斯拉).
我正在使用Retrofit来集成我的Web服务,我不明白如何使用POST请求将JSON对象发送到服务器.我目前卡住了,这是我的代码:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Retrofit retrofit = new Retrofit.Builder().baseUrl(url).
addConverterFactory(GsonConverterFactory.create()).build();
PostInterface service = retrofit.create(PostInterface.class);
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("email", "device3@gmail.com");
jsonObject.put("password", "1234");
} catch (JSONException e) {
e.printStackTrace();
}
final String result = jsonObject.toString();
}
Run Code Online (Sandbox Code Playgroud)
public interface PostInterface {
@POST("User/DoctorLogin")
Call<String> getStringScalar(@Body String body);
}
Run Code Online (Sandbox Code Playgroud)
{
"email":"device3@gmail.com",
"password":"1234"
}
Run Code Online (Sandbox Code Playgroud)
{
"error": false,
"message": "User Login Successfully",
"doctorid": 42,
"active": true
}
Run Code Online (Sandbox Code Playgroud)