0

I'm inserting a custom field in a HTTP request via

req.insert("some-custom-header-field-name", "some-value");

On the server side I fetch field names via

boost::beast::http::to_string(field.name()).data()

However, instead of the expected field name it will be

<unknown-field>

How do I set custom field names in Beast?

benjist
  • 2,740
  • 3
  • 31
  • 58

1 Answers1

1

In this case it's required to use field.name_string() instead of the to_string() method which I was using. The latter resolves to an unknown field in this case.

benjist
  • 2,740
  • 3
  • 31
  • 58