Feature Request: Support special-use domain names like localhost.
Checklist
- [x] I've searched for similar feature requests. There is an FR from 2015: #373
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 …
@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!
It will be fixed with #1531