         self.operationQueue.addOperation(operation)
     }
     open func apiPutOperation(_ api:String,contentType:String,postData:Data,complete:@escaping IPaURLResourceUIResultHandler) -> IPaURLRequestUploadOperation {
-        return apiUploadOperation(api, method: "PUT", headerFields: ["content-type":contentType], data: postData, complete: complete)
+        return apiUploadOperation(api, method: HttpMethod.put, headerFields: ["content-type":contentType], data: postData, complete: complete)
     }
     open func apiPost(_ api:String,contentType:String,postData:Data,complete:@escaping IPaURLResourceUIResultHandler) {
         let operation = apiPostOperation(api, contentType: contentType,postData:postData,complete: complete)
         self.operationQueue.addOperation(operation)
     }
     open func apiPostOperation(_ api:String,contentType:String,postData:Data,complete:@escaping IPaURLResourceUIResultHandler) -> IPaURLRequestUploadOperation {
-        return apiUploadOperation(api, method: "POST", headerFields: ["content-type":contentType], data: postData, complete: complete)
+        return apiUploadOperation(api, method: HttpMethod.post, headerFields: ["content-type":contentType], data: postData, complete: complete)
     }
     open func apiDelete(_ api:String,contentType:String,postData:Data,complete:@escaping IPaURLResourceUIResultHandler) {
         let operation = self.apiDeleteOperation(api, contentType: contentType, postData: postData, complete: complete)
         self.operationQueue.addOperation(operation)
     }
     open func apiDeleteOperation(_ api:String,contentType:String,postData:Data,complete:@escaping IPaURLResourceUIResultHandler) -> IPaURLRequestUploadOperation {
-        return apiUploadOperation(api, method: "DELETE", headerFields: ["content-type":contentType], data: postData, complete: complete)
+        return apiUploadOperation(api, method: HttpMethod.delete, headerFields: ["content-type":contentType], data: postData, complete: complete)
     }
     func handleResponse(_ responseData:Data?,response:URLResponse?,error:Error?) -> Result<(URLResponse?,Any?),Error> {
         if let error = error {

        }
        return apiDataOperation(with: request,complete:complete)
    }
    open func apiUpload(_ api:String,method:String,headerFields:[String:String]?,json:Any,complete:@escaping IPaURLResourceUIResultHandler) throws {
        let operation = try apiUploadOperation(api, method: method,headerFields:headerFields, json: json, complete: complete)
        self.operationQueue.addOperation(operation)
    }
    open func apiUploadOperation(_ api:String,method:String,headerFields:[String:String]?,json:Any,complete:@escaping IPaURLResourceUIResultHandler) throws -> IPaURLRequestOperation {

        do {
            let jsonData = try JSONSerialization.data(withJSONObject: json, options: JSONSerialization.WritingOptions(rawValue: 0))

    {
        let apiURL = urlString(for: api, params: params)
        var request = URLRequest(url: URL(string: apiURL!)!)
        request.httpMethod = HttpMethod.get.rawValue
        
        return apiDataOperation(with: request as URLRequest,complete:complete)
    }
