Skip to content

decodeUrl(with___)

MarcoDotIO edited this page Apr 25, 2023 · 1 revision

decodeUrl(with:_:)

Decodes the contents of the specified URL into a JSON object using the specified HTTP method.

public func decodeUrl(with url: URL, _ method: HTTPMethod = .get)

Parameters

  • url: The URL to decode.
  • method: The HTTP method to use for the request, with a default value of .get.

Throws

An error if the decoding process fails.

Returns

The decoded JSON object.

decodeUrl(with:_:)

Decodes the contents of the specified URL into a JSON object using the specified HTTP method and request body.

public func decodeUrl(with url: URL, _ body: [String: Any])

Parameters

  • url: The URL to decode.
  • body: The request body as a dictionary of key-value pairs.

Throws

An error if the decoding process fails.

Returns

The decoded JSON object.

Types
Protocols
Global Variables
Global Functions
Extensions

Clone this wiki locally