Skip to content

Instantly share code, notes, and snippets.

View Antuaaan's full-sized avatar
🏠
Remote coding

Anton Mansvelt Antuaaan

🏠
Remote coding
  • Self-Employed
  • Cape Town
View GitHub Profile
@mombrea
mombrea / volley-POST-example.java
Last active July 28, 2024 21:16
Example of performing a POST request using Google Volley for Android
public static void postNewComment(Context context,final UserAccount userAccount,final String comment,final int blogId,final int postId){
mPostCommentResponse.requestStarted();
RequestQueue queue = Volley.newRequestQueue(context);
StringRequest sr = new StringRequest(Request.Method.POST,"http://api.someservice.com/post/comment", new Response.Listener<String>() {
@Override
public void onResponse(String response) {
mPostCommentResponse.requestCompleted();
}
}, new Response.ErrorListener() {
@Override