title: unexpected response code 401 for URL
body: <pre><code>package com.example.murarilal.volley;
  
  import android.content.Intent;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Base64;
  import android.util.Log;
  import android.view.View;
  import android.widget.Adapter;
  import android.widget.AdapterView;
  import android.widget.ArrayAdapter;
  import android.widget.ListAdapter;
  import android.widget.ListView;
  
  import com.android.volley.AuthFailureError;
  import com.android.volley.Request;
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.VolleyError;
  import com.android.volley.toolbox.JsonObjectRequest;
  import com.android.volley.toolbox.StringRequest;
  import com.android.volley.toolbox.Volley;
  
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.List;
  import java.util.ListIterator;
  import java.util.Map;
  
  public class MainActivity extends AppCompatActivity {
      RequestQueue queue;
      ListView listView;
      List&lt;Hero&gt; heroList;
  
      private String url="API_KEY";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
           queue= Volley.newRequestQueue(this);
          home();
  
          listView = (ListView) findViewById(R.id.listView);
          heroList = new ArrayList&lt;&gt;();
  
          listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
  
                  Intent intent=new Intent(getApplicationContext(),ArticleActivity.class);
                  intent.putExtra("description",url);
                  startActivity(intent);
              }
          });
      }
  
      public void home()
      {
          JsonObjectRequest request =new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener&lt;JSONObject&gt;() {
              @Override
              public void onResponse(JSONObject response) {
  
                  try {
                      JSONObject obj = new JSONObject(String.valueOf(response));
  
                      JSONArray array = obj.getJSONArray("articles");
  
                      for (int i = 0; i &lt; array.length(); i++) {
                          Hero hero=new Hero( (String) array.getJSONObject(i).get("title"),(String) array.getJSONObject(i).get("urlToImage"));
                          heroList.add(hero);
                      }
  
                      ListViewAdapter adapter = new ListViewAdapter(heroList, getApplicationContext());
                      listView.setAdapter(adapter);
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
          }
                  , new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
  
              }
          });
          queue.add(request);
      }
  }
  
  
  package com.example.murarilal.volley;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.Snackbar;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.View;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  public class ArticleActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_article);
          String url="https://newsapi.org/v1/articles?source=techcrunch&amp;apiKey=59b308aec9f242fe98b527ab9ba93199";
  
          WebView webView=(WebView)findViewById(R.id.webView);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.setWebViewClient(new WebViewClient());
  
          Intent intent=getIntent();
          webView.loadDataWithBaseURL(url,null,intent.getStringExtra("description"),"text/html","UTF-8");
          webView.loadUrl(url);
      }
  }
  </code></pre>
  
  <p><a href="https://newsapi.org/v2/top-headlines?sources=techcrunch&amp;apiKey=d6eaad863cc640a7a6864d18196bea9e" rel="nofollow noreferrer">https://newsapi.org/v2/top-headlines?sources=techcrunch&amp;apiKey=d6eaad863cc640a7a6864d18196bea9e</a></p>
  
  <p>I'm trying to fetch data from the above <strong>url</strong> but it returns an unexpected 401 response code. I checked the url and it's perfectly valid but the my code gives this error. when the emulator starts it shows blank activity</p>
  
  <p><strong>this the log error</strong></p>
  
  <blockquote>
    <p>11-17 16:20:20.804 14350-14350/com.example.murarilal.volley
    W/System.err: com.android.volley.AuthFailureError 11-17 16:20:20.804
    14350-14350/com.example.murarilal.volley W/System.err:     at
    com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:141)
    11-17 16:20:20.804 14350-14350/com.example.murarilal.volley
    W/System.err:     at
    com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:105)</p>
  </blockquote>