         case URL                    = "url"
     }
     
-    // JSON KEY
-    
     
     // API PARAMS
-    let url                     : NSURL!
-    var ouput                   : ResponseOutput = ResponseOutput.NSDictionary
-    var agent                   : String?
-    var parameter               : NSDictionary?
-    
-    private(set) internal var totalDataDownloading    : NSMutableData!
-    private var totalLengthDownloading  : Int64 = 0
-    private var currentLengthDownloaded : Int64 = 0
+    var ouput                                           : ResponseOutput = ResponseOutput.NSDictionary
+    private(set) internal var url                       : NSURL!
+    private(set) internal var agent                     : String!
+    private(set) internal var parameter                 : NSDictionary!
+    private(set) internal var objectJsonRequest         : NSDictionary!
+    
+    private(set) internal var totalDataDownloaded       : NSMutableData!
+    private(set) internal var expectLengthDownloading   : Int64 = 0
+    private(set) internal var totalLengthDownloaded     : Int64 = 0
+    private(set) internal var errorDownloading          : NSError?
     
     var completionDownloading   : ((data :NSData?, totalLengthDownloading: Int64, currentLengthDownloaded: Int64, error: Bool)-> Void)?
     

        UIApplication.sharedApplication().networkActivityIndicatorVisible = setVisible
    }
    
    func addParameterWithKey(key: String, value: String) {
        var p : NSMutableDictionary?
        if parameter == nil { p = NSMutableDictionary() }
        else { p = NSMutableDictionary(dictionary: parameter!) }

import Foundation
import UIKit

/// Ascy Manager NetWork V1.1
class ApiNetwork : NSObject, NSURLConnectionDataDelegate {
    
    
    private struct ActivityManager {  static var NumberOfCallsToSetVisible : Int32 = 0 }
    
    /**
    Output Response
    
    - NSDictionary
    - NSData
    - String
    */
    enum ResponseOutput {
        case NSDictionary
        case String
        case NSData
    }
    
    /**
    Request Method HTTP/1.1
    
    - POST
    - GET
    - DELETE
    - PUT
    */
    enum MethodRequest : String {
        case POST                   = "POST"
        case GET                    = "GET"
        case DELETE                 = "DELETE"
        case PUT                    = "PUT"
        case HEAD                   = "HEAD"
        case CONNECT                = "CONNECT"
    }
    
    /**
    The func launchRequest and launchRequestWithNSURL return a description
    of the Request in JSON. KeyResult is the key to acces to each information
    of the Request
    
    - CODE_RESPONSE     : satut code of Request ex: 404,200, 201
    - CONNECTION_ERROR  : error description of the request
    - RESPONSE          : response of the request depends of the ResponseOutput
    - HRADER            : header of the request
    - MIME_TYPE         : myme type of the request ex:application/json
    - URL               : response url request
    */
    enum KeyResult : String {
        case CODE_RESPONSE          = "status code"
        case CONNECTION_ERROR       = "errors"
