Repository navigation
Conversation
* Stop advertising problem details media types The JSON and XML formatters no longer list application/problem+json and application/problem+xml among their readable media types, so the Accept header that the client builds no longer includes them. The formatters still read them through the +json and +xml suffix rules. The documentation no longer describes problem details, because the library has no specific support for them. * Decode XML responses as RFC 7303 specifies Without a charset parameter, XmlFormatter decoded the content as UTF-8 through a text reader, so the XML encoding declaration was ignored. A byte order mark now decides the encoding, then the charset parameter, then the encoding declaration, with UTF-8 as the default. * Keep the path of a base address without a trailing slash BaseAddress appended the slash by resolving "/" against the address, which replaces its path, so http://example.com/api became http://example.com/ instead of http://example.com/api/. * Recognize more transient network errors IsTransientNetworkError now also treats as transient: - An IOException, including HttpIOException, which reports a connection closed before the response was complete, unless it is an HTTP/2 or HTTP/3 protocol error. - A WebException of .NET Framework for a failed connection, send, or receive, a connection closed early, a failed host name resolution, or a timeout. - SocketError.Shutdown, which .NET on Unix reports for a write to a connection the peer closed, and AddressNotAvailable, NoBufferSpaceAvailable, and TooManyOpenSockets, which report exhausted local ports, buffers, or sockets. Every SocketError and WebExceptionStatus value is listed explicitly. Retries still do not depend on the request method. * Correct documentation - CompressedContent is sent with chunked transfer encoding only over HTTP/1.1. - The shared HttpClient is disposed with its last client, so clients share a connection pool only while they exist at the same time. - The user guide and SharedHttpClient.Factory explain how to make the shared HttpClient follow DNS changes with PooledConnectionLifetime. * Add tests for untested behavior Tests cover body parsing failures, cancellation while reading a body, unreadable error bodies, connection failures that are not retried, SharedHttpClient.Factory, a 401 handler that gets no new authorization, PerformAsync<T>, and the ToString of HttpResponseException and HttpContentException. * Add the .NET Framework test project to the solution, and use collection expressions in test assertions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stop advertising problem details media types
The JSON and XML formatters no longer list application/problem+json and application/problem+xml among their readable media types, so the Accept header that the client builds no longer includes them. The formatters still read them through the +json and +xml suffix rules. The documentation no longer describes problem details, because the library has no specific support for them.
Decode XML responses as RFC 7303 specifies
Without a charset parameter, XmlFormatter decoded the content as UTF-8 through a text reader, so the XML encoding declaration was ignored. A byte order mark now decides the encoding, then the charset parameter, then the encoding declaration, with UTF-8 as the default.
Keep the path of a base address without a trailing slash
BaseAddress appended the slash by resolving "/" against the address, which replaces its path, so http://example.com/api became http://example.com/ instead of http://example.com/api/.
Recognize more transient network errors
IsTransientNetworkError now also treats as transient:
Correct documentation
Add tests for untested behavior
Tests cover body parsing failures, cancellation while reading a body, unreadable error bodies, connection failures that are not retried, SharedHttpClient.Factory, a 401 handler that gets no new authorization, PerformAsync, and the ToString of HttpResponseException and HttpContentException.
Add the .NET Framework test project to the solution, and use collection expressions in test assertions