Coder Social home page Coder Social logo

Please help a noob. about swifthttp HOT 2 CLOSED

daltoniam avatar daltoniam commented on July 24, 2024
Please help a noob.

from swifthttp.

Comments (2)

acmacalister avatar acmacalister commented on July 24, 2024

Some code I whipped up off hand. I didn't test it, but should give you the basic idea.

import SwiftHTTP

var request = HTTPTask()
let params: Dictionary<String,AnyObject> = ["text": "这是中文测试"]
request.requestSerializer = JSONRequestSerializer()
request.requestSerializer.headers["X-Mashape-Key"] = "jhzbBPIPLImsh26lfMU4Inpx7kUPp1lzNbijsncZYowlZdAfAD"
request.responseSerializer = JSONResponseSerializer()
request.POST("https://textanalysis.p.mashape.com/segmenter", parameters: params, success: {(response: HTTPResponse) in
    if let json = response.responseObject {
        println("json is: \(json)")
    }
    },failure: {(error: NSError, response: HTTPResponse?) in
         println("\(error)")
    })

from swifthttp.

webmagnets avatar webmagnets commented on July 24, 2024

Thank you very much for the time you are spending too help me.

from swifthttp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.