PlainBodyProvider
public protocol PlainBodyProvider
A provider for plain text body data.
The PlainBodyProvider protocol defines a type that provides a body for plain text data.
It requires conforming types to specify an associated type Body that conforms to the Encodable protocol
and to provide a body property of that type.
Example usage:
struct MyPlainRequest: PlainBodyProvider {
struct Body: Encodable {
let content: String
}
var body: Body
var encoding: String.Encoding
}
-
The body of the plain text data.
This property holds the body of the plain text data.
Declaration
Swift
var body: String { get } -
encodingDefault implementationThe encoding used for the plain text data.
This property holds the encoding used for the plain text data.
Default Implementation
The encoding used for the plain text data.
This property holds the encoding used for the plain text data. Default implementation is
.utf8Note
This property is required by thePlainBodyProviderprotocol.Declaration
Swift
var encoding: String.Encoding { get }
View on GitHub