Skip to content

Does Alamofire actually work with scripts? #5

@mgrebenets

Description

@mgrebenets

I'm trying to make it work, using a basic sample, which is supposed to have JSON response.

Alamofire.request(.GET, "http://httpbin.org/get")
    .responseJSON { (_, _, JSON, _) in
        println("done")
        println(JSON)
    }

println("last")

When I run the script, it just exits and print nothing from network request, only the "last" bit is printed.

I suspect that's due to async behavior of Alamofire. Do I have to do additional synchronization myself to make sure the script doesn't exit before n/w response gets back?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions