Created
November 25, 2014 22:07
-
-
Save mbarcia/32447bc55d03cce783a5 to your computer and use it in GitHub Desktop.
postImage() you can add to your MyApi class. Read more about a multipart request at http://stackoverflow.com/a/9082243
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Request<?> postImage( | |
String token, | |
long l, | |
File imageFile, | |
Listener<String> listener, | |
ErrorListener errorListener) { | |
String url = "http://yoururl.com/post-image"; | |
PhotoMultipartRequest<String> req = new PhotoMultipartRequest<String>( | |
url, | |
errorListener, | |
listener, | |
imageFile); | |
req.setRetryPolicy(new DefaultRetryPolicy( | |
POST_TIMEOUT, | |
2, | |
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); | |
return mQueue.add(req); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment