【问题标题】:Exception when using httparty for itunes verification使用 httparty 进行 iTunes 验证时出现异常
【发布时间】:2010-10-12 11:25:18
【问题描述】:

这是我为实现 itunes_verification 编写的一段代码。

http://gist.github.com/raw/622038/b32accd30e86f7c714f2cffefd19857f558c8d97/gistfile1.rb

ItunesVerification.verify_apple_receipt("wefwfrw")

但是,它总是从 iTunes 服务器抛出 {"exception"=>"java.lang.NullPointerException", "status"=>21002}。

#<HTTParty::Response:0x46d59a8 @parsed_response={"exception"=>"java.lang.NullPointerException", "status"=>21002}, @response=#<Net::HTTPOK 200 Apple WebObjects readbody=true>, @headers={"x-webobjects-loadaverage"=>["0"], "x-apple-application-site"=>["SB"], "expires"=>["Thu, 14 Oct 2010 04:24:12 GMT"], "connection"=>["keep-alive"], "edge-control"=>["no-store", "max-age=0"], "pod"=>["100"], "date"=>["Thu, 14 Oct 2010 04:24:12 GMT"], "x-apple-max-age"=>["0"], "x-apple-application-instance"=>["1000407"], "x-apple-woa-inbound-url"=>["/WebObjects/MZFinance.woa/wa/verifyReceipt?output=json&receipt-data=d2Vmd2U%3D%0A"], "content-length"=>["62"], "set-cookie"=>["Pod=100; version=\"1\"; expires=Sun, 14-Nov-2010 05:24:12 GMT; path=/; domain=.apple.com", "mzf_in=1000407; version=\"1\"; path=/WebObjects; domain=.apple.com"], "x-apple-lokamai-no-cache"=>["true"], "cache-control"=>["no-transform", "private", "no-cache", "no-store", "must-revalidate", "max-age=0"], "pragma"=>["no-cache"]}>

另外,我传递的字符串被编码为 Base64。

我尝试了其他选项,例如将键从“body”更改为“query”。

这是非常紧急的,任何帮助将不胜感激。

谢谢

【问题讨论】:

    标签: ruby itunes-store httparty


    【解决方案1】:

    已经有类似问题贴出来了,check it out here,或许那里的建议可以帮到你。

    【讨论】:

    • 在将字符串编码为 Base64 并将其传递为 :body=>{"apple-receipt"=>"d2Vmd2U=\n"} 后我仍然得到相同的异常
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-18
    • 1970-01-01
    • 1970-01-01
    • 2021-11-30
    • 1970-01-01
    • 2015-09-11
    • 2016-09-21
    相关资源
    最近更新 更多