ServiceStack / Issues

Issue Tracker for the commercial versions of ServiceStack
11 stars 8 forks source link

Dart: Unable to set headers using requestFilters #757

Closed rockgecko-development closed 3 years ago

rockgecko-development commented 3 years ago

For Flutter apps, I use JsonServiceClient.globalRequestFilter to set the user-agent header. A recent change to the ServiceStack client lib has moved the call to req.write(bodyStr) before the filters are called. It used to be after. I now get an error saying the request headers are immutable.

The Flutter documentation for the write method states:

The client request headers can be modified until the client request body is written to or closed. After that they become immutable.

mythz commented 3 years ago

The latest release servicestack dart library has this update.