Skip to content

Releases: postmates/PMHTTP

PMHTTP v4.1.1

22 Jun 04:25
Compare
Choose a tag to compare
  • Add HTTPHeaders.merge(_:uniquingKeysWith:) and HTTPHeaders.merging(_:uniquingKeysWith:).
  • Deprecate HTTPHeaders.append(contentsOf:).
  • Merge header fields when calling HTTPManagerRequest.setDefaultEnvironmentalProperties(), giving priority to existing request header fields in the case of a conflict.

PMHTTP v4.1.0

16 Jun 05:24
Compare
Choose a tag to compare
  • Support mocking relative URLs when no environment has been set.
  • Shrink the default mock delay to 10ms.
  • Make HTTPManagerRequest.headerFields mutable in Obj-C.
  • Add HTTPManager.defaultHeaderFields which defines the default header fields to attach to requests and, like defaultAuth, only applies to requests within the current environment.
  • Declare conformance to Equatable for HTTPManagerRequest.HTTPHeaders.
  • Fix fatal error when using deferred multipart bodies along with serverRequiresContentLength.
  • Add HTTPManager.metricsCallback to collect task metrics (URLSessionTaskMetrics) from all tasks associated with the HTTPManager.

PMHTTP v4.0.1

18 May 02:13
Compare
Choose a tag to compare
  • Fix <PMHTTP/PMHTTP.h> so it can be imported from Obj-C++ code.

PMHTTP v4.0.0

24 Feb 04:27
Compare
Choose a tag to compare
  • Convert to Swift 4.
  • Add a method HTTPManagerParseRequest.map(_:).
  • Add methods HTTPManagerDataRequest.decodeAsJSON(_:with:options:) and HTTPManagerActionRequest.decodeAsJSON(_:with:options:).

PMHTTP v3.0.5

11 Sep 19:04
Compare
Choose a tag to compare
  • Extend HTTPAuth to support handling 403 Forbidden errors as well.

PMHTTP v3.0.4

05 Sep 21:03
Compare
Choose a tag to compare
  • Support Swift 3.2.
  • Handle serverRequiresContentLength correctly in preparedURLRequest.

PMHTTP v3.0.3

18 Aug 22:52
Compare
Choose a tag to compare
  • Add overloads to the request creation methods that take a URL. These overloads return a non-optional request.
  • Add new property HTTPManagerRequest.serverRequiresContentLength. This disables streaming body support (for JSON and multipart/mixed) and instead encodes the body synchronously so it can provide a "Content-Length" header to the server. There is a corresponding HTTPManager.defaultServerRequiresContentLength property as well.
  • Add a method HTTPManagerRequest.setDefaultEnvironmentalProperties() that sets properties to the HTTPManager-defined defaults that otherwise are only set if the request's path matches the environment. This is primarily intended for requests constructed using absolute paths (e.g. HTTP.request(GET: "/foo")) that should still use the environment defaults. Right now this method only sets auth and serverRequiresContentLength.

PMHTTP v3.0.2

01 May 21:35
Compare
Choose a tag to compare
  • Add @discardableResult to Obj-C -performRequest… methods.

PMHTTP v3.0.1

29 Mar 03:56
Compare
Choose a tag to compare
  • Fix Xcode 8.3 compatibility.

PMHTTP v3.0.0

27 Feb 21:40
Compare
Choose a tag to compare
  • Preserve network task priority when retrying tasks.
  • Add convenience Obj-C function PMHTTPErrorIsFailedResponse to test PMHTTP errors easily.
  • Add methods .parseAsImage(scale:) and .parseAsImage(scale:using:) to HTTPManagerDataRequest and HTTPManagerActionRequest.
  • When a session is reset, cancel any tasks that were created but never resumed.
  • Ensure that the completion block is always deallocated on either the completion queue or on the thread that created the task. Previously there was a very subtle race that meant the completion block could deallocate on the URLSession's delegate queue instead. This only matters if your completion block captures values whose deinit cares about the current thread.
  • Expand dictionaries, arrays, and sets passed as parameters. Dictionaries produce keys of the form "foo[bar]" and arrays and sets just use the key multiple times (e.g. "foo=bar&foo=qux"). The expansion is recursive. The order of values from expanded dictionaries and sets is implementation-defined. If you want "array[]" syntax, then put the "[]" in the key itself. See the documentation comments for more details. Do note that this behavior is slightly different from what AFNetworking does.
  • Also expand nested URLQueryItems in parameters. The resulting parameter uses dictionary syntax ("foo[bar]").
  • Change the type signature of the Obj-C parse methods that take handlers to make the error parameter non-optional.
  • Provide a callback that can be used for session-level authentication challenges. This can be used to implement SSL pinning using something like TrustKit.
  • Fix a small memory leak when retrying tasks.
  • Rework how authorization works. The defaultCredential and credential properties have been replaced with defaultAuth and auth, using a brand new protocol HTTPAuth. An implementation of Basic authentication is provided with the HTTPBasicAuth object. This new authentication mechanism has been designed to allow for OAuth2-style refreshes, and a helper class HTTPRefreshableAuth is provided to make it easy to implement refreshable authentication.