Skip to content

Instantly share code, notes, and snippets.

View kh4zad's full-sized avatar

Adrián Rodríguez kh4zad

View GitHub Profile
@kh4zad
kh4zad / GZIPEncoding.swift
Last active September 18, 2024 07:15
GZIP encoding for Alamofire requests
import Alamofire
import Gzip // using https://github.com/1024jp/GzipSwift
public struct GZIPEncoding: ParameterEncoding {
public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
var request = try urlRequest.asURLRequest()
guard let parameters = parameters else { return request }