RequestHTTPMethod
@propertyWrapper
public struct RequestHTTPMethod : Encodable
A property wrapper for the HTTP method of a request.
The RequestHTTPMethod property wrapper provides a convenient way to manage the HTTP method of a request.
It allows you to specify the HTTP method for a request using a property wrapper syntax.
Example usage:
@RequestHTTPMethod var httpMethod: HTTPMethod = .post
-
The wrapped value representing the HTTP method.
This property holds the
HTTPMethodvalue that is managed by this property wrapper.Declaration
Swift
public var wrappedValue: HTTPMethod -
Initializes a new instance of
RequestHTTPMethodwith the specified wrapped value.Example usage:
@RequestHTTPMethod var httpMethod: HTTPMethod = .postDeclaration
Swift
public init(wrappedValue: HTTPMethod = .get)Parameters
wrappedValueThe wrapped value representing the HTTP method. Defaults to
.get.
View on GitHub