     }
     open func apiPutOperation(_ api:String, params:[String:Any]?,complete:@escaping IPaURLResourceUIResultHandler) -> IPaURLRequestDataOperation {
         
-        return apiDataOperation(api ,method:"PUT", params:params,complete:complete)
-    }
-    
-    
-    open func apiData(_ api:String,method:String,headerFields:[String:String]? = nil,params:[String:Any]?,complete:@escaping IPaURLResourceUIResultHandler) {
+        return apiDataOperation(api ,method:HttpMethod.put, params:params,complete:complete)
+    }
+    
+    
+    open func apiData(_ api:String,method:HttpMethod,headerFields:[String:String]? = nil,params:[String:Any]?,complete:@escaping IPaURLResourceUIResultHandler) {
         let operation = apiDataOperation(api, method: method, headerFields:headerFields, params:params, complete: complete)
         self.operationQueue.addOperation(operation)
     }
-    open func apiDataOperation(_ api:String,method:String,headerFields:[String:String]? = nil,params:[String:Any]?,complete:@escaping IPaURLResourceUIResultHandler) -> IPaURLRequestDataOperation
+    open func apiDataOperation(_ api:String,method:HttpMethod,headerFields:[String:String]? = nil,params:[String:Any]?,complete:@escaping IPaURLResourceUIResultHandler) -> IPaURLRequestDataOperation
 
     {
-        let method = method.uppercased()
-        let apiURL = urlString(for: api)
-        var request = URLRequest(url: URL(string: apiURL)!)
-        if let params = params {
-            
-            let valuePairs:[String] = params.map { (key,value) in
-                let value = "\(value)".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? ""
-                return "\(key)=\(value)"
-            }
-            let postString = valuePairs.joined(separator: "&")
-            request.httpBody = postString.data(using: String.Encoding.utf8, allowLossyConversion: false)
-            
-        }
-        
-        request.httpMethod = method
+        var apiURL:String
+        var request:URLRequest
+        if method == .get {
+            apiURL = urlString(for: api, params: params)
+            request = URLRequest(url: URL(string: apiURL)!)
+        }
+        else {
+            apiURL = urlString(for: api)
+            request = URLRequest(url: URL(string: apiURL)!)
+            if let params = params {
+                
+                let valuePairs:[String] = params.map { (key,value) in
+                    let value = "\(value)".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? ""
+                    return "\(key)=\(value)"
+                }
+                let postString = valuePairs.joined(separator: "&")
+                request.httpBody = postString.data(using: String.Encoding.utf8, allowLossyConversion: false)
+            }
+        }
+        
+        
+        
+        request.httpMethod = method.rawValue
         request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "content-type")
         if let fields = headerFields {
             for (key,value) in fields {

        }
        
    }
    func apiUpload(_ api:String,method:String,headerFields:[String:String]?,file:Any,complete:@escaping IPaURLResourceUIResultHandler) {
        let operation = self.apiUploadOperation(api, method: method, headerFields: headerFields,file:file, complete: complete)
        self.operationQueue.addOperation(operation)
    }
    func apiUploadOperation(_ api:String,method:String,headerFields:[String:String]?,file:Any,complete:@escaping IPaURLResourceUIResultHandler) -> IPaURLRequestUploadOperation {
        let apiURL = urlString(for: api)
        var request = URLRequest(url:URL(string: apiURL)!)
        request.httpMethod = method
        if let headerFields = headerFields {
            for (key,value) in headerFields {
                request.setValue(value, forHTTPHeaderField: key)

import IPaNetworkState
public typealias IPaURLResourceUIResultHandler = ((Result<(URLResponse?,Any?),Error>) ->())
open class IPaURLResourceUI : NSObject {
    public enum HttpMethod:String {
        case get = "GET"
        case post = "POST"
        case put = "PUT"
        case delete = "DELETE"
    }
    
    @objc open var baseURL:String! = ""
    @objc open var removeNSNull:Bool = true
