Skip to content

Instantly share code, notes, and snippets.

@kibotu
Last active November 24, 2015 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kibotu/85edb5f7ea55f2298902 to your computer and use it in GitHub Desktop.
Save kibotu/85edb5f7ea55f2298902 to your computer and use it in GitHub Desktop.
gson request methods annotation
import android.support.annotation.IntDef;
import com.android.volley.Request;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@IntDef({
Request.Method.DEPRECATED_GET_OR_POST,
Request.Method.GET,
Request.Method.POST,
Request.Method.PUT,
Request.Method.DELETE,
Request.Method.HEAD,
Request.Method.OPTIONS,
Request.Method.TRACE,
Request.Method.PATCH,
})
@Retention(RetentionPolicy.SOURCE)
public @interface RequestMethod {
}
public Request<JSONObject> createJsonRequest(@RequestMethod final int method, @NotNull final String url, @NotNull String json, @NotNull final IResponse<JSONObject> callback, @Nullable Map<String, String> headerParams);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment