             if parameters.isEmpty == false,
                 let u = URL(string: url),
                 var components = URLComponents(url: u, resolvingAgainstBaseURL: false) {
-                let encodedQuery = (components.percentEncodedQuery.map { $0 + "&" } ?? "") + URLRequest.query(parameters)
+                let encodedQuery = (components.percentEncodedQuery.map { $0 + "&" } ?? "") + parameters.query
                 components.percentEncodedQuery = encodedQuery
                 if let encodeUrl = components.url?.absoluteString {
                     self.init(method: method.rawString, url: encodeUrl, body: nil)

        self.httpBody = body
        self.httpShouldHandleCookies = true
        self.httpShouldUsePipelining = true
    }
}



extension URLRequest {
    public enum HTTPMethod: Int {
        case get = 0, head, delete, post
    }
    public enum ContentType: Int {
        case www_form_urlencoded = 0, json
    }
}

extension URLRequest.HTTPMethod {
    init?(rawString: String) {
        switch rawString {
        case "GET": self = .get
        case "HEAD": self = .head
        case "DELETE": self = .delete
        case "POST": self = .post
        default:
            // unsupport type: "OPTIONS" "PUT" "PATCH" "TRACE" "CONNECT"
            return nil
        }
    }
    var rawString: String {
        switch self {
        case .get: return "GET"
        case .head: return "HEAD"
        case .delete: return "DELETE"
        case .post: return "POST"
        }
    }
}

extension URLRequest.ContentType {
    init?(rawString: String) {
        switch rawString {
        case "application/x-www-form-urlencoded": self = .www_form_urlencoded
        case "application/json": self = .json
        default:
            // unsupport type "charset=utf-8", "multipart/form-data", "text/xml"
            return nil
        }
    }
    var rawString: String {
        switch self {
        case .www_form_urlencoded: return "application/x-www-form-urlencoded"
        case .json: return "application/json"
        }
    }
}

extension URLRequest {
    public init?(method: HTTPMethod, url: String, parameters: [String: Any]? = nil, contentType: ContentType? = nil) {
        guard let parameters = parameters else {
            self.init(method: method.rawString, url: url, body: nil)
            return
