featherbed icon indicating copy to clipboard operation
featherbed copied to clipboard

Inconsistent behaviour of 'accept' method

Open ilya-murzinov opened this issue 8 years ago • 2 comments

This compiles

    val req = 
      .put("foo/bar")
      .withContent("Hello world", "text/plain")
      .accept("text/plain")

    req.send[String]()

But this doesn't

    val req = client
      .put("foo/bar")
      .accept("text/plain")
      .withContent("Hello world", "text/plain")

    req.send[String]()

with because can't find implicit CanBuildRequest instance

ilya-murzinov avatar May 18 '16 13:05 ilya-murzinov

@ilya-murzinov is this still an issue? Could be related to withContent (or other subsequent methods) confusing the type inference of the overall request. If it's still an issue, I'm not sure it can be solved, but it should at least be documented. (#notetoself)

jeremyrsmith avatar Sep 02 '16 21:09 jeremyrsmith

@jeremyrsmith yes, this is still an issue. To my intuition, seems that accept should always go last, otherwise there is some issue with type inference.

ilya-murzinov avatar Sep 03 '16 16:09 ilya-murzinov