You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Networking] Return error on HTTP 4xx and 5xx responses + utils (#64)
This is a bug fix that is also a breaking change. Network requests that
technically succeeded in being performed but resulted in HTTP error
codes (4xx or 5xx) used to be returned as non-errors (`Result::kOk`).
With this change, such responses will be returned with an error status
(`Result::kError`) instead to simplify error handling for library users.
Additionally, a new helper functions were added to `ResourceResponse`
class:
* `base::net::ResourceResponse::DataAsString()`
* creates a copy of the response data in `std::string` object
* `base::net::ResourceResponse::DataAsStringView()`
* creates a non-owning view of the response data in `std::string_view`
object
These should also make it simpler to use response data by library users.
0 commit comments