httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
32.74k stars 3.68k forks source link

Feature Request: Support special-use domain names like localhost. #1458

Open joeblubaugh opened 1 year ago

joeblubaugh commented 1 year ago

Checklist


Enhancement request

HTTPie should resolve special domain names per RFC6761, unless HTTPie uses a name resolution library that isn't part of the code base. According to the RFC:

Name resolution APIs and libraries SHOULD recognize localhost names as special and SHOULD always return the IP loopback address for address queries and negative responses for all other query types. Name resolution APIs SHOULD NOT send queries for localhost names to their configured caching DNS server(s).


Problem it solves

I use k3d to develop software. It assigns localhost domains to Services, for example: grafana.k3d.localhost:8080. If httpie resolved .localhost domain names as the loopback address I could use it for scripting in my local development environment. As it stands, I'm using CURL, but httpie is faster and more pleasant to write.


Additional information, screenshots, or code examples

Curl has implemented support for this somewhat recently: https://github.com/curl/curl/pull/9296

osdiab commented 1 year ago

@jakubroztocil @isidentical any chance this can be considered by the maintainers? I found this counterintuitive that it didn't work, sounds like per the RFC linked above this might make sense to support. Thanks!

Ousret commented 1 month ago

It will be fixed with #1531