async-http-client icon indicating copy to clipboard operation
async-http-client copied to clipboard

HTTPClient.Request.url is a let constant

Open weissi opened this issue 3 years ago • 1 comments

HTTPClient.Request is a value type (as it should be). Its properties should be mutable (var). Otherwise a mere

var request = request
request.url = newURL

becomes a tedious

var request = request
request =HTTPClient.Request(url: newURL,
                               method: request.method,
                               headers: request.headers,
                               body: request.body)

weissi avatar Jul 07 '21 14:07 weissi

Relevant prior conversations:

  • https://github.com/swift-server/async-http-client/pull/56#issuecomment-510110349
  • https://github.com/swift-server/async-http-client/pull/67#discussion_r305006373

Lukasa avatar Jul 07 '21 14:07 Lukasa