Skip to content

API Recommendation: using HTTPRequest with HTTPClient is confusing #16

Open
@jentfoo

Description

@jentfoo

I think this comes down to several things:

  1. I think we should remove HTTPAddress. I understand why this class makes sense internally for connection management. However it complicates the API. I think most people expect to just use the URL object (which the API technically also accepts). Understanding the differences between them at an API level is confusing, even more so because of:

  2. The HTTPRequestBuilder is confusing. It can accept a String path, a HTTPAddress as well as a URL. It is not obvious what is being set and needs to be set in all cases, particularly because when making a request with on in the HTTPClient a HTTPAddress must also be specified. But wait, was it not set earlier? Does it need to match? What if we are using a URL?

I think the HTTP client should never accept the host, instead getting it either from a URL or the request. Allowing there never to be any confusion.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions