123456789101112131415161718192021222324252627282930313233343536373839 |
- import Foundation
- extension URLRequest {
-
- public var method: HTTPMethod? {
- get { httpMethod.flatMap(HTTPMethod.init) }
- set { httpMethod = newValue?.rawValue }
- }
- public func validate() throws {
- if method == .get, let bodyData = httpBody {
- throw AFError.urlRequestValidationFailed(reason: .bodyDataInGETRequest(bodyData))
- }
- }
- }
|