Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. String url = "https://newsapi.org/v2/everything";
  2.         JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET, url + "?q=china", null, jsonobject ->
  3.                 textView.setText(jsonobject.toString())
  4.                 , Throwable::printStackTrace) {
  5.             @Override
  6.             public Map<String, String> getHeaders() {
  7.                 Map<String, String> headers = new HashMap<>();
  8.                 headers.put("Authorization", apikey);
  9.                 return headers;
  10.             }
  11.         };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement