- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试制作 Paypal's sandbox API工作,我正在使用一个示例项目,我得到的错误是
response was: {"responseEnvelope":{"timestamp":"2011-12-26T12:35:19.560-08:00","ack":"Success","correlationId":"ea7c82ca4d096","build":"2279004"},"payKey":"AP-53K115241G5252300","paymentExecStatus":"CREATED"}
headers must be str
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1522, in __call__
return response(environ, start_response)
File "/base/python27_runtime/python27_lib/versions/third_party/webob-1.1.1/webob/response.py", line 939, in __call__
start_response(self.status, headerlist)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 129, in _StartResponse
raise InvalidResponseError('headers must be str')
InvalidResponseError: headers must be str
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 174, in Handle
result = handler(self._environ, self._StartResponse)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1524, in __call__
return self._internal_error(e)(environ, start_response)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1522, in __call__
return response(environ, start_response)
File "/base/python27_runtime/python27_lib/versions/third_party/webob-1.1.1/webob/response.py", line 939, in __call__
start_response(self.status, headerlist)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 129, in _StartResponse
raise InvalidResponseError('headers must be str')
InvalidResponseError: headers must be str
在生产中它是同样的错误:
response was: {"responseEnvelope":{"timestamp":"2011-12-26T13:18:13.932-08:00","ack":"Success","correlationId":"d84672a2d6b1e","build":"2279004"},"payKey":"AP-2GA190885R390622U","paymentExecStatus":"CREATED"}
headers must be str
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1522, in __call__
return response(environ, start_response)
File "/base/python27_runtime/python27_lib/versions/third_party/webob-1.1.1/webob/response.py", line 939, in __call__
start_response(self.status, headerlist)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 129, in _StartResponse
raise InvalidResponseError('headers must be str')
InvalidResponseError: headers must be str
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 174, in Handle
result = handler(self._environ, self._StartResponse)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1524, in __call__
return self._internal_error(e)(environ, start_response)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1522, in __call__
return response(environ, start_response)
File "/base/python27_runtime/python27_lib/versions/third_party/webob-1.1.1/webob/response.py", line 939, in __call__
start_response(self.status, headerlist)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 129, in _StartResponse
raise InvalidResponseError('headers must be str')
InvalidResponseError: headers must be str
试图运行的代码是
self.raw_response = url_request( "%s%s" % ( settings.PAYPAL_ENDPOINT, "Pay" ), data=self.raw_request, headers=headers ).content()
logging.info( "response was: %s" % self.raw_response )
self.response = json.loads( self.raw_response )
我正在尝试从 github 上的示例运行代码。这可能与我的设置有关吗?我尝试了一个以点结尾的签名和一个不以点结尾的签名,结果相同:上面的错误消息。你能推荐我应该做什么吗?
问题几乎可以肯定是由于从 python 2.5 升级到 2.7,因为如果我降级,问题就会消失。我可以记录标题,它们看起来确实是字符串:
INFO 2011-12-31 08:43:03,286 paypal.py:143] headers: {'X-PAYPAL-REQUEST-DATA-FORMAT': 'JSON', 'X-PAYPAL-SECURITY-PASSWORD': '1425859477', 'X-PAYPAL-RESPONSE-DATA-FORMAT': 'JSON', 'X-PAYPAL-SECURITY-SIGNATURE': 'Al6H4Bq5kp4bKF5tyfR-p2FlAbpY5JFKl54FMzHpo.QKYew5obtYPIm.', 'X-PAYPAL-SECURITY-USERID': 'niklas_1364582637_biz_api1.eddaconsult.se', 'X-PAYPAL-DEVICE-IPADDRESS': '127.0.0.1', 'X-PAYPAL-APPLICATION-ID': 'APP-80W284485P519543T'}
INFO 2011-12-31 08:43:04,909 paypal.py:57] response was: {"responseEnvelope":{"timestamp":"2011-12-31T00:43:06.083-08:00","ack":"Success","correlationId":"bf0c9db7a13cb","build":"2279004"},"payKey":"AP-25U92494YK276842W","paymentExecStatus":"CREATED"}
ERROR 2011-12-31 08:43:04,925 webapp2.py:1528] headers must be str
当我使用 tcpdump 时,日志中没有什么特别的:
$ sudo tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
18:38:31.988690 IP6 fe80::914b:d0c9:3c27:919e.52450 > ff02::c.1900: UDP, length 146
18:38:31.989603 IP ubuntu.local.49948 > resolver1.comhem.se.domain: 9999+ PTR? c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
18:38:31.989914 ARP, Request who-has OM-DOC-1-Bu30.comhem.se tell c213-89-134-0.bredband.comhem.se, length 46
18:38:32.006004 IP resolver1.comhem.se.domain > ubuntu.local.49948: 9999 NXDomain 0/1/0 (160)
18:38:32.006401 IP ubuntu.local.57850 > resolver1.comhem.se.domain: 20237+ PTR? e.9.1.9.7.2.c.3.9.c.0.d.b.4.1.9.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)
18:38:32.017844 IP resolver1.comhem.se.domain > ubuntu.local.57850: 20237 NXDomain* 0/1/0 (125)
18:38:32.018075 IP ubuntu.local.51652 > resolver1.comhem.se.domain: 5935+ PTR? 11.245.255.83.in-addr.arpa. (44)
18:38:32.027394 IP resolver1.comhem.se.domain > ubuntu.local.51652: 5935 1/3/3 PTR resolver1.comhem.se. (186)
18:38:32.027530 IP ubuntu.local.35513 > resolver1.comhem.se.domain: 34706+ PTR? 10.0.168.192.in-addr.arpa. (43)
18:38:32.037746 IP resolver1.comhem.se.domain > ubuntu.local.35513: 34706 NXDomain 0/1/0 (120)
18:38:32.138234 IP6 fe80::219:b9ff:fe06:928e.mdns > ff02::fb.mdns: 0 PTR (QM)? 10.0.168.192.in-addr.arpa. (43)
18:38:32.138273 IP ubuntu.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 10.0.168.192.in-addr.arpa. (43)
18:38:32.138349 IP ubuntu.local.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/0 (Cache flush) PTR ubuntu.local. (63)
18:38:32.138675 IP ubuntu.local.50349 > resolver1.comhem.se.domain: 36768+ PTR? 1.128.89.213.in-addr.arpa. (43)
18:38:32.165618 IP resolver1.comhem.se.domain > ubuntu.local.50349: 36768 1/3/3 PTR OM-DOC-1-Bu30.comhem.se. (189)
18:38:32.165826 IP ubuntu.local.39699 > resolver1.comhem.se.domain: 32574+ PTR? 0.134.89.213.in-addr.arpa. (43)
18:38:32.174200 IP resolver1.comhem.se.domain > ubuntu.local.39699: 32574 1/3/3 PTR c213-89-134-0.bredband.comhem.se. (198)
18:38:32.174493 IP ubuntu.local.58622 > resolver1.comhem.se.domain: 34645+ PTR? b.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
18:38:32.236655 IP resolver1.comhem.se.domain > ubuntu.local.58622: 34645 NXDomain 0/1/0 (160)
18:38:32.236852 IP ubuntu.local.52609 > resolver1.comhem.se.domain: 3885+ PTR? e.8.2.9.6.0.e.f.f.f.9.b.9.1.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)
18:38:32.245937 IP resolver1.comhem.se.domain > ubuntu.local.52609: 3885 NXDomain* 0/1/0 (125)
18:38:32.246143 IP ubuntu.local.43779 > resolver1.comhem.se.domain: 20440+ PTR? 251.0.0.224.in-addr.arpa. (42)
18:38:32.257346 IP resolver1.comhem.se.domain > ubuntu.local.43779: 20440 NXDomain 0/1/0 (99)
18:38:32.357753 IP6 fe80::219:b9ff:fe06:928e.mdns > ff02::fb.mdns: 0 PTR (QM)? 251.0.0.224.in-addr.arpa. (42)
18:38:32.357798 IP ubuntu.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 251.0.0.224.in-addr.arpa. (42)
18:38:32.474703 IP 192.168.0.11.6646 > 192.168.0.255.6646: UDP, length 170
18:38:32.475021 IP 192.168.0.11.51530 > ubuntu.local.netbios-ssn: Flags [S], seq 88766685, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
18:38:32.475035 IP ubuntu.local.netbios-ssn > 192.168.0.11.51530: Flags [R.], seq 0, ack 88766686, win 0, length 0
18:38:32.971416 IP 192.168.0.11.51530 > ubuntu.local.netbios-ssn: Flags [S], seq 88766685, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
18:38:32.971436 IP ubuntu.local.netbios-ssn > 192.168.0.11.51530: Flags [R.], seq 0, ack 1, win 0, length 0
18:38:33.358818 IP6 fe80::219:b9ff:fe06:928e.mdns > ff02::fb.mdns: 0 PTR (QM)? 251.0.0.224.in-addr.arpa. (42)
18:38:33.358856 IP ubuntu.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 251.0.0.224.in-addr.arpa. (42)
18:38:33.471329 IP 192.168.0.11.51530 > ubuntu.local.netbios-ssn: Flags [S], seq 88766685, win 8192, options [mss 1460,nop,nop,sackOK], length 0
18:38:33.471347 IP ubuntu.local.netbios-ssn > 192.168.0.11.51530: Flags [R.], seq 0, ack 1, win 0, length 0
18:38:33.481836 IP 192.168.0.11.51377 > ubuntu.local.1900: UDP, length 97
18:38:33.481853 IP ubuntu.local > 192.168.0.11: ICMP ubuntu.local udp port 1900 unreachable, length 133
18:38:33.482624 IP 192.168.0.11.51378 > 224.0.0.251.mdns: 0 [7q] PTR (QM)? _pdl-datastream._tcp.local. PTR (QM)? _printer._tcp.local. PTR (QM)? _ipp._tcp.local. PTR (QM)? _http._tcp.local. PTR (QM)? _workstation._tcp.local. PTR (QM)? _eppc._tcp.local. PTR (QM)? _net-assistant._tcp.local. (198)
18:38:33.482773 IP ubuntu.local.mdns > 192.168.0.11.51378: 0*- [7q],,,,,, 5/0/0 PTR ubuntu [00:19:b9:06:92:8e]._workstation._tcp.local., TXT "", SRV ubuntu.local.:9 0 0, AAAA fe80::219:b9ff:fe06:928e, A 192.168.0.10 (259)
18:38:34.988668 IP6 fe80::914b:d0c9:3c27:919e.52450 > ff02::c.1900: UDP, length 146
18:38:35.360953 IP6 fe80::219:b9ff:fe06:928e.mdns > ff02::fb.mdns: 0 PTR (QM)? 251.0.0.224.in-addr.arpa. (42)
18:38:35.360996 IP ubuntu.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 251.0.0.224.in-addr.arpa. (42)
18:38:36.751649 IP ubuntu.local.50394 > www-17-02-ash3.facebook.com.www: Flags [F.], seq 3090446013, ack 1136569104, win 130, options [nop,nop,TS val 12239647 ecr 2503075665], length 0
18:38:37.258743 IP ubuntu.local.49776 > resolver1.comhem.se.domain: 55236+ PTR? 255.0.168.192.in-addr.arpa. (44)
18:38:37.270032 IP resolver1.comhem.se.domain > ubuntu.local.49776: 55236 NXDomain 0/1/0 (121)
18:38:37.370372 IP6 fe80::219:b9ff:fe06:928e.mdns > ff02::fb.mdns: 0 PTR (QM)? 255.0.168.192.in-addr.arpa. (44)
18:38:37.370416 IP ubuntu.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 255.0.168.192.in-addr.arpa. (44)
18:38:37.918371 IP ubuntu.local.51337 > stackoverflow.com.www: Flags [F.], seq 3843139898, ack 3903597436, win 273, options [nop,nop,TS val 12239764 ecr 81335008], length 0
18:38:37.978365 ARP, Request who-has 192.168.0.11 tell ubuntu.local, length 28
18:38:37.978650 ARP, Reply 192.168.0.11 is-at f0:bf:97:5a:59:c7 (oui Unknown), length 46
18:38:37.988729 IP6 fe80::914b:d0c9:3c27:919e.52450 > ff02::c.1900: UDP, length 146
18:38:38.347231 IP stackoverflow.com.www > ubuntu.local.51355: Flags [F.], seq 439312178, ack 401000312, win 16, options [nop,nop,TS val 81340163 ecr 12238306], length 0
18:38:38.371686 IP6 fe80::219:b9ff:fe06:928e.mdns > ff02::fb.mdns: 0 PTR (QM)? 255.0.168.192.in-addr.arpa. (44)
18:38:38.371737 IP ubuntu.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 255.0.168.192.in-addr.arpa. (44)
18:38:38.378349 IP ubuntu.local.51355 > stackoverflow.com.www: Flags [.], ack 1, win 123, options [nop,nop,TS val 12239810 ecr 81340163], length 0
18:38:38.941011 IP ubuntu.local.50416 > www-17-02-ash3.facebook.com.www: Flags [S], seq 653211239, win 14600, options [mss 1460,sackOK,TS val 12239866 ecr 0,nop,wscale 7], length 0
18:38:39.057758 IP www-17-02-ash3.facebook.com.www > ubuntu.local.50416: Flags [S.], seq 1083765460, ack 653211240, win 4380, options [mss 1460,nop,wscale 0,nop,nop,TS val 2503201763 ecr 12239866,sackOK,eol], length 0
18:38:47.283299 IP ubuntu.local.55413 > resolver1.comhem.se.domain: 22287+ PTR? 54.242.171.69.in-addr.arpa. (44)
18:38:47.291897 IP resolver1.comhem.se.domain > ubuntu.local.55413: 22287 1/3/0 PTR www-17-02-ash3.facebook.com. (139)
18:38:47.292194 IP ubuntu.local.58277 > resolver1.comhem.se.domain: 55103+ PTR? 12.119.34.64.in-addr.arpa. (43)
18:38:47.301399 IP resolver1.comhem.se.domain > ubuntu.local.58277: 55103 1/2/0 PTR stackoverflow.com. (119)
18:38:47.989062 IP6 fe80::914b:d0c9:3c27:919e.52450 > ff02::c.1900: UDP, length 146
最佳答案
我相信您遇到了 webapp2 的错误/功能。
redirect() 不接受 unicode
它必须是 str
。
尝试将 main.py #91 行更改为:
self.redirect( pay.next_url().encode('ascii') ) # go to paypal
关于python - 使用 Paypal 沙箱 API 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8634446/
我正在使用 node.js 和 mocha 单元测试,并且希望能够通过 npm 运行测试命令。当我在测试文件夹中运行 Mocha 测试时,测试运行成功。但是,当我运行 npm test 时,测试给出了
我的文本区域中有这些标签 ..... 我正在尝试使用 replaceAll() String 方法替换它们 text.replaceAll("", ""); text.replaceAll("", "
早上好,我是 ZXing 的新手,当我运行我的应用程序时出现以下错误: 异常Ljava/lang/NoClassDefFoundError;初始化 ICOM/google/zxing/client/a
我正在制作一些哈希函数。 它的源代码是... #include #include #include int m_hash(char *input, size_t in_length, char
我正在尝试使用 Spritekit 在 Swift 中编写游戏。目的是带着他的角色迎面而来的矩形逃跑。现在我在 SKPhysicsContactDelegate (didBegin ()) 方法中犯了
我正在尝试创建一个用于导入 CSV 文件的按钮,但出现此错误: actionPerformed(java.awt.event.ActionEvent) in cannot implement
请看下面的代码 public List getNames() { List names = new ArrayList(); try { createConnection(); Sta
我正在尝试添加一个事件以在“dealsArchive”表中创建一个条目,然后从“deals”表中删除该条目。它需要在特定时间执行。 这是我正在尝试使用的: DELIMITER $$ CREATE EV
我试图将两个存储过程的表结果存储到 phpmyadmin 例程窗口中的单个表中,这给了我 mariadb 语法错误。单独调用存储过程给出了结果。 存储过程代码 BEGIN CREATE TABLE t
我想在 videoview 中加载视频之前有一个进度条。但是我收到以下错误。我还添加了所有必要的导入。 我在 ANDROID 中使用 AIDE 这是我的代码 public class MainActi
我已经使用了 AsyncTask,但我不明白为什么在我的设备 (OS 4.0) 上测试时仍然出现错误。我的 apk 构建于 2.3.3 中。我想我把代码弄错了,但我不知道我的错误在哪里。任何人都请帮助
我在测试 friend 网站的安全性时,通过在 URL 末尾添加 ' 发现了 SQL 注入(inject)漏洞该网站是用zend框架构建的我遇到的问题是 MySQL -- 中的注释语法不起作用,因此页
我正在尝试使用堆栈溢出答案之一的交互式信息窗口。 链接如下: interactive infowindow 但是我在代码中使用 getMap() 时遇到错误。虽然我尝试使用 getMapAsync 但
当我编译以下代码时出现错误: The method addMouseListener(Player) is undefined for the type Player 代码: import java.
我是 Android 开发的初学者。我正在开发一个接收 MySql 数据然后将其保存在 SQLite 中的应用程序。 我将 Json 用于同步状态,以便我可以将未同步数据的数量显示为要同步的待处理数据
(这里是Hello world级别的自动化测试人员) 我正在尝试下载一个文件并将其重命名以便于查找。我收到一个错误....这是代码 @Test public void allDownload(
我只是在写另一个程序。并使用: while (cin) words.push_back(s); words是string的vector,s是string。 我的 RAM 使用量在 4 或 5
我是 AngularJS 的新手,我遇到了一个问题。我有一个带有提交按钮的页面,当我单击提交模式时必须打开并且来自 URL 的数据必须存在于模式中。现在,模式打开但它是空的并且没有从 URL 获取数据
我正在尝试读取一个文件(它可以包含任意数量的随机数字,但不会超过 500 个)并将其放入一个数组中。 稍后我将需要使用数组来做很多事情。 但到目前为止,这一小段代码给了我 no match for o
有些人在使用 make 命令进行编译时遇到了问题,所以我想我应该在这里尝试一下,我已经在以下操作系统的 ubuntu 32 位和挤压 64 位上尝试过 我克隆了 git 项目 https://gith
我是一名优秀的程序员,十分优秀!