2

For this simple example taken straight from the docs:

Fuel.get("https://httpbin.org/get", listOf("foo" to "foo", "bar" to "bar"))
    .also { println(it.url) }

This prints out https://httpbin.org/get, as opposed to https://httpbin.org/get?foo=foo&bar=bar

How do I fix this? I'm using fuel 2.1.0

marianosimone
  • 3,366
  • 26
  • 32
nz_21
  • 6,140
  • 7
  • 34
  • 80
  • from the docs, that is expected behaviour ? `Fuel.post("https://httpbin.org/post", listOf("foo" to "foo", "bar" to "bar")) .also { println(it.url) }` this prints : `https://httpbin.org/post` – a_local_nobody Aug 03 '19 at 15:53
  • 1
    No, I'm talking about a `get` request. – nz_21 Aug 03 '19 at 16:03

1 Answers1

1

It's just a representation of Fuel Request. It doesn't construct the full url instantly. The parameters are fine. You can check the response for example:

val (request, response, result) = Fuel.get(
    "https://httpbin.org/get", listOf("foo" to "foo", "bar" to "bar")
).response()
println(response.url) // prints https://httpbin.org/get?foo=foo&bar=bar
Andrei Tanana
  • 7,932
  • 1
  • 27
  • 36