تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4382 أدوات العرض

Hi, i try to do an HTTP POST request but I have an error with this line :

sock = socket.create_connection((conn.host, conn.port), conn.timeout, conn.source_address)

Error:

  File "/usr/local/lib/python2.7/dist-packages/odoo-9.0c-py2.7.egg/openerp/addons/Copa/purchase.py", line 191, in sendOrder
sock = socket.create_connection((conn.host, conn.port), conn.timeout, conn.source_address) File "/usr/lib/python2.7/socket.py", line 553, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): gaierror: [Errno -2] Name or service not known

I have no idea what is the problem, in advance, thanks for help.

الصورة الرمزية
إهمال

The problem is that I'm trying to connect me to the host 'connect.company.com/xmlorder-test'


I have done a test with just 'connect.company.com' , it works because there is no error


But I have to connect me to the full url, how can I do this please ?

الكاتب أفضل إجابة

Ok, I just have to connect me to the second part of the URL with 

conn.request("POST","/xmlorder-test",request)

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يناير 17
19295
1
يوليو 15
21500
2
سبتمبر 22
6237
1
يوليو 25
2144
1
سبتمبر 22
15909