如何发送请求标头?假设我想在向网站发出 HTTP 请求时发送自己的请求标头。
我怎么做 ?
URL url = new URL(urlString);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// HOW DO I SEND REQUEST HEADER LIKE Date,Cookie,Cache-Control ???
如何发送请求标头?假设我想在向网站发出 HTTP 请求时发送自己的请求标头。
我怎么做 ?
URL url = new URL(urlString);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// HOW DO I SEND REQUEST HEADER LIKE Date,Cookie,Cache-Control ???