grillon icon indicating copy to clipboard operation
grillon copied to clipboard

Support string literal for header built-in functions

Open theredfish opened this issue 2 years ago • 0 comments

The API should be a bit more more natural without all the boilerplate for passing expected headers. We keep the current way, for flexibility purpose, but we add the possibility to provide &str tuples :

.headers(vec![
   ("Content-Type", "application/json; charset=utf-8"),
   ("Content-Length", "42"),
])

It will be less verbose compared to :

.headers(contains(vec![
   (
      CONTENT_TYPE,
      HeaderValue::from_static("application/json; charset=utf-8"),
   ),
   (
      CONTENT_LENGTH, HeaderValue::from_static("15")
   )
]))

theredfish avatar Feb 16 '23 19:02 theredfish