I'd like to make some scripted like network traffic from an android phone. Is it possible to complete the task by making an HTTP request from adb shell? I noticed there is "adb shell ping" command that may test the network connectivity, but it does not generate HTTP request. I am thinking something like some utility similar to telnet.
EDIT: I see Open a broswer will serve my purpose, although not quite elegantly Need command line to start web browser using adb
Netcat may work, if available:
$ nc www.example.com 80
GET / HTTP/1.1
Host: www.example.com
i.e. enter the first line on the command line, and the two HTTP protocol lines to standard input.
This returns:
HTTP/1.1 200 OK
Age: 185995
Cache-Control: max-age=604800
Content-Type: text/html; charset=UTF-8
Date: Mon, 10 May 2021 10:39:58 GMT
Etag: "3147526947+gzip+ident"
Expires: Mon, 17 May 2021 10:39:58 GMT
Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT
Server: ECS (nyb/1D07)
Vary: Accept-Encoding
X-Cache: HIT
Content-Length: 1256
<!doctype html>
<html>
<head>
<title>Example Domain</title>
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With