Re: [U2] callHTTP creating Header (Karl-Heinz Winter)
I found the solution by myself! The problem could be, that the functions 'setRequestHeader' und addRequestParameter' are formatting the data in any way, that the webserver doesn`t understand the request. When I logged the outgoing traffic to port 80, I have seen valuemarks in the header information. On Pickwiki there is a good example of calling a web service: http://www.pickwiki.com/cgi-bin/wiki.pl?CallHTTP. The second example shows how to do a request with OPENSOCKET, WRITESOCKET and READSOCKET. These classes are posting the data without any change. I tried it and the webserver response ist OK! Karl-Heinz old message was: Message: 1 Date: Tue, 23 Aug 2011 21:03:31 +0200 From: Karl-Heinz Winter karl-heinz.win...@freenet.de To: u2-users@listserver.u2ug.org Subject: [U2] callHTTP creating Header Message-ID: 4e53f983.10...@freenet.de Content-Type: text/plain; charset=ISO-8859-15; format=flowed in a header with post-data I have to create the header-information like this: Content-type: text/xml;charset=UTF-8 Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 When creating it with setRequestHeader or with addRequestParamete I will receive the error 415 (Unsupported media type) from the server. How can I create the correct header? Thanks in advance Karl-Heinz ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] callHTTP creating Header (Karl-Heinz Winter)
Karl - your original request said: How can I create the correct header? My mental response was stop bothering with CallHTTP and use cURL. I refrained from posting that because of the inevitable retribution from people who prefer to bang their heads against flaky software rather than just looking outside of the box for a real solution. ( oh he is sooo asking for it...) But now that you've moved from CallHTTP to sockets. Mein Gott, Mann! Nein Nein! Tun Sie nicht das! Sockets are much lower-level than what you need to do HTTP calls. If you have a good solution to your problem, OK, sockets are great for doing many things. And it's nice if you found free code that does exactly what you need. But if you don't actually need complex software at that level, then for maintainability later, you should consider a higher-level solution. Well, that's my opinion anyway - use the right tools for the job, and all that... Viel Erfolg! T From: Karl-Heinz Winter The second example shows how to do a request with OPENSOCKET, WRITESOCKET and READSOCKET. These classes are posting the data without any change. I tried it and the webserver response ist OK! When creating it with setRequestHeader or with addRequestParamete I will receive the error 415 (Unsupported media type) from the server. How can I create the correct header? ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users