简体   繁体   中英

SyntaxError : Unexpected POST_IF error

options = {
    host : 'http://localhost:8080'
    port : 8080
    path : '.frameset?__report=stock_report.rptdesign'
}

http.get(options , (res) ->
    console.log "Got response : " + res.statusCode
    res.on 'data' , (chunk) ->
        console.log "BODY : " + chunk
    ).on 'error' , (e) ->
    console.log "Got error : " + e.message

I want to sent http request for tomcat server in nodejs. But Unexpected POST_IF error occur. Why?

If you combine tabs with spaces for indentation, or use wrong indentation then coffeescript gives Unexpected POST_IF error. Solutions:

-- Make sure you're using only tab or space for indentation
-- If you're in Intellij Idea, Code -> Reformat Code (it tries to put indents correctly)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM