Latest 1.0.0
Homepage https://github.com/hilen/Swift_cURLCommand
License MIT
Platforms ios 8.0, requires ARC
Authors

Build Status

Extension to get the cURL command for your NSURLRequest, Swift 2.0

Requirements

  • iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 7.2+

CocoaPods

To integrate Swift_cURLCommand into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Swift_cURLCommand', '~> 1.0.0'

Working with Alamofire

import Swift_cURLCommand

let URLString = "https://httpbin.org/get"
let parameters = [
    "foo":"bar"
]
let request = Alamofire.request(.GET, URLString, parameters: parameters, encoding:.JSON).responseJSON { response in
    switch response.result {
    case .Success(let JSON):
        print("Success with JSON: (JSON)")
        success!(JSON as! NSDictionary)
    case .Failure(let error):
        print("Request failed with error: (error)")
        failure!(error)
    }
}
print("n request cURL command:(request.request!.cURLCommandString()) n")

Latest podspec

{
    "name": "Swift_cURLCommand",
    "version": "1.0.0",
    "summary": "Extension to get the cURL command for your NSURLRequest in Swift project",
    "homepage": "https://github.com/hilen/Swift_cURLCommand",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Hilen": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/hilen/Swift_cURLCommand.git",
        "commit": "95f04f691070045c9a9d2bf336bb1bdc165a0ae0",
        "tag": "1.0.0"
    },
    "source_files": "Source/*.swift",
    "requires_arc": true
}

Pin It on Pinterest

Share This