 
     func post(data: AnyObject? = nil, url: String?=nil, headers: [String:String]?=nil, completionHandler: CompletionHandler? = nil, errorHandler: ErrorHandler? = nil) { //contentType, postData
         var fullURL = self.getFullURL(url)
-     
+        println("FullURL=\(fullURL)")
         if let request = self.generateURLRequest(fullURL, method: HTTPMethod.POST) {
-            self.setHeaders(request, headers)
-            if let concreteData: AnyObject = data {
-                if let type = self.detectDataType(concreteData) {
-                    self.setContentType(request, type)
+//            self.setHeaders(request, headers)
+//            if let concreteData: AnyObject = data {
+//                if let type = self.detectDataType(concreteData) {
+//                    self.setContentType(request, type)
+//                }
+                if let json = data! as? JSON {
+
+                    let text = json.toString(pretty: true) as String
+                    println("BODY=\(text)")
+                    let data = text.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! as NSData
+                    request.HTTPBody = data
+                    
+                    request.setValue("application/json",  forHTTPHeaderField:"Content-Type")
                 }
-
-                request.HTTPBody = concreteData.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)
-            }          
+//                else {
+//                    request.HTTPBody = concreteData.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)
+//                }
+
+//            }          
             var httpLayer = HTTPLayer(completionHandler, errorHandler)
             httpLayer.delegate = self
             httpLayer.request(request)

                ]))
        }
    }
    /// access json data object
    public var data:AnyObject? {
        return self.isError ? nil : self._value

    }

    private func setContentType(request: NSMutableURLRequest, _ type: NKContentType) {
        println("Set content type: \(type.rawValue)")
        request.setValue(type.rawValue,  forHTTPHeaderField:"Content-Type")
    }

    private func detectDataType(data: AnyObject) -> NKContentType? {
