asJson and asXml

The note on https://gatling.io/docs/current/http/http_request/ says:

There are two handful methods to help you set the required headers for JSON and XML requests:

  • http(“foo”).get(“bar”).asJson is equivalent to:

    http(“foo”).get(“bar”)

  • http(“foo”).get(“bar”).asXml is equivalent to:

    http(“foo”).get(“bar”)

Are the equivalent values supposed to be longer and show some more detailed header information? I was thinking asJson was a shorthand replacement for some more complicated equivalent.

Thanks,
Richard

This is an error in the doc, thanks for pointing that out!

It should be:

http("foo").get("bar")
  .header("Accept", "application/json")
  .header("Content-Type", "application/json")