HttpData
public enum HttpData
The HttpData enum is an empty enumeration that is merely used to put different implementations
of HttpBody into a common scope. Out of the box, Squid provides HttpData.Empty,
HttpData.Json and HttpData.Image which all implement the HttpBody protocol.
-
The image HTTP body can be used to attach an image to a request. Currently, only PNG and JPEG images are supported. When adding the image’s data to the body of the request, this body also sets the “Content-Type” header to the appropriate MIME type as well as the “Content-Length” header to the size of the image in bytes.
See moreDeclaration
Swift
public struct Image : HttpBody, Hashable -
The JSON HTTP body is presumably the most commonly used non-empty body for HTTP requests. It encodes an encodable type as JSON and sets the body of an HTTP request as well as the “Content-Type” header to “application/json”.
See more
View on GitHub
HttpData Enumeration Reference