HTTP Requests

Perform HTTP GET requests from the CLI

On this page

Make HTTP requests to web servers and APIs from the CLI.

Fetch content from a URL:

ethhttp <url> [lines_to_show|all]

Parameters:

  • <url> - The full URL (supports http:// and https://)
  • <lines_to_show> - Number of response lines to display, or all for the complete response. Optional; if omitted, the first 25 lines are shown.

Examples:

Fetch the first 25 lines (default):

ethhttp https://example.com

Fetch the first 10 lines of a webpage:

ethhttp https://example.com 10

Fetch the entire response:

ethhttp https://example.com all

Fetch from a specific path:

ethhttp https://api.example.com/status 5

Use Cases:

  • API Testing - Query REST APIs
  • Web Scraping - Retrieve website content
  • Service Verification - Check if a service is responding
  • Configuration - Fetch remote config files

Troubleshooting

  • Connection refused - Ensure the server is running and accessible from your network
  • Timeout - The server may be unreachable or slow to respond
  • SSL/TLS errors - Some servers may require specific certificates; try http:// instead of https://