question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP: Make header Methods Accept CharSequences as Values

See original GitHub issue

Gatling 3.4 deprecates io.gatling.http.HeaderValues in favour of io.netty.handler.codec.http.HttpHeaderValues. Hence, all header value constants are now AsciiStrings, not Strings. However, the various methods for setting headers still demand Strings as values. They should be changed to accept CharSequences (or Expression[CharSequence]s) as values instead.

In a nutshell, I want to be able to write:

http("example")
    .get("/my/url")
    .header(ACCEPT, TEXT_HTML)
    .headers(Map(    
        CACHE_CONTROL → NO_CACHE,
        PRAGMA → NO_CACHE
    ))

currently, I am forced to write:

http("example")
   .get("/my/url")
   .header(ACCEPT, s"$TEXT_HTML")
   .headers(Map(    
       CACHE_CONTROL → s"$NO_CACHE",
       PRAGMA → s"$NO_CACHE"
   ))

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
slandellecommented, Sep 30, 2020

Thanks for reporting.

We’ll have to weight going this way or revert the deprecation. If we could the former, I’m afraid this is not something we’ll be able to do before Gatling 3.5.0 because it would break binary compatibility.

0reactions
jGleitzcommented, Oct 1, 2020

#3973 is also a good solution for us. Thank you for addressing the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

HttpHeaders (Vert.x Stack - Docs 4.3.6 API)
Contains a bunch of useful HTTP headers stuff: methods for creating MultiMap instances; often used Header names; method to create optimized CharSequence ......
Read more >
HttpHeaders (Netty API Reference (4.1.86.Final))
Provides the constants for the standard HTTP header names and values and commonly used utility methods that accesses an HttpMessage .
Read more >
Accept - HTTP - MDN Web Docs
The Accept request HTTP header indicates which content types, expressed as MIME types, the client is able to understand.
Read more >
MutableHttpRequest (javadoc 2.2.3 API)
An extended version of HttpRequest that allows mutating headers, the body etc. ... ACCEPT header. ... Methods inherited from interface io.micronaut.http.
Read more >
HttpHeaders (Vertx Javadocs 3.9.6.GA API)
Contains often used Header names. It also contains a utility method to create optimized CharSequence which can be used as header name and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found