简体   繁体   English

SyntaxError:意外的POST_IF错误

[英]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. 我想在nodejs中发送tomcat服务器的http请求。 But Unexpected POST_IF error occur. 但发生意外的POST_IF错误。 Why? 为什么?

If you combine tabs with spaces for indentation, or use wrong indentation then coffeescript gives Unexpected POST_IF error. 如果将制表符与空格组合以进行缩进,或使用错误的缩进,则coffeescript会出现意外的POST_IF错误。 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) - 如果你在Intellij Idea,Code - > Reformat Code(它试图正确地缩进)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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