thedarkside
V2EX  ›  编程

发现 lua 的 request:getResponseData()一个奇怪现象

  •  
  •   thedarkside · Jul 7, 2015 · 3454 views
    This topic created in 3992 days ago, the information mentioned may be changed or developed.

    大概是这样的,同事用app post数据去我的一个php,然后获取并用request:getResponseData()打印我返回给他的json串,可结果是怎么也打印不出该json字符串,而返回其它字符串给它却可以打印出来,比如我print_r一个array再加上该json都可以获取到,唯独单一的json就不行.

    app端如下

    local ok = (event.name == "completed")
    local request = event.request
    local response = request:getResponseData()
    print("111111111")
    print(response)
    local json=require("framework.json")
    print("2222222")

    我的php端就是直接 echo {"code":"100","message":"login_success","userid":"5","token":"cc17e7cf566559a7ddfdda3c361d3b2"}

    吊诡的问题,不知道V友们遇到过没有~~~~

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5481 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 02:56 · PVG 10:56 · LAX 19:56 · JFK 22:56
    ♥ Do have faith in what you're doing.