Skip to content

Instantly share code, notes, and snippets.

View professionalsna's full-sized avatar
💭
Working

Naveed Ahmed professionalsna

💭
Working
View GitHub Profile
@professionalsna
professionalsna / volley-POST-example.java
Created October 23, 2017 06:27 — forked from mombrea/volley-POST-example.java
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