Swift-SRWebClient icon indicating copy to clipboard operation
Swift-SRWebClient copied to clipboard

Code=503 "The operation couldn’t be completed.

Open ghousesgb opened this issue 10 years ago • 1 comments

public func uploadImage(urlString:String, imageFile:UIImage, handler:(responseObject:AnyObject? , success: Bool?)-> Void) { let imageData:NSData = UIImageJPEGRepresentation(imageFile, 1.0) SRWebClient.POST(urlString) .data(imageData, fieldName:"image", data:["apiKey":apiKey,"folder":folderName,"tags":tagNames]) .send({(response:AnyObject!, status:Int) -> Void in println(status) println(response) handler(responseObject: response, success: true) },failure:{(error:NSError!) -> Void in println(error) handler(responseObject: error, success: false) }) }

Optional(<NSHTTPURLResponse: 0x7ff06053e8f0> { URL: http://img-cloud.herokuapp.com/upload } { status code: 503, headers { "Cache-Control" = "no-cache, no-store"; Connection = "keep-alive"; "Content-Length" = 484; "Content-Type" = "text/html; charset=utf-8"; Date = "Tue, 01 Sep 2015 10:49:40 GMT"; Server = Cowboy; } }) Error Domain=/upload Code=503 "The operation couldn’t be completed. (/upload error 503.)"

Any Solution or anything I'm doing it wrong?

ghousesgb avatar Sep 01 '15 10:09 ghousesgb

I Know that, HTTP Error 503 - Service unavailable. But with same mac machine, I could able to upload through web browser

ghousesgb avatar Sep 01 '15 11:09 ghousesgb