Karl,
I have used both setrequestheader and addrequestparameter without issues.

Add 3 parameters using AddRequestParameter:
   sub httpPostXML
   h = '';rh = '';rd = '';rs = '';sh = ''; pd = ''; sch = '';cf=''
   URL = 'http://myuri'
   boundary = '----------':system(99)
   z = createRequest(URL,'POST:multipart/form-data; boundary=':boundary,h)
   z = addRequestParameter(h,'user_id','9999999','Content-Disposition: 
form-data; name="user_id"')
   z = addRequestParameter(h,'pwd','*pa55*','Content-Disposition: form-data; 
name="pwd"')
   ct = 'Content-Disposition: form-data; name="invoice_xml"; 
filename="test.xml"':@am:'Content-Type: text/xml'
   cv = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE cXML SYSTEM 
"http://xml.cXML.org/schemas/cXML/1.2.009/InvoiceDetail.dtd";><cXML  etc'
   if not(addRequestParameter(h,'invoice_xml',cv,ct)) then
      crt 'status     :': submitRequest(h,25000,pd,rh,rd,rs)
      crt 'headers    :':rh
      crt 'data       :':rd
      crt 'httpstatus :':rs
   end


Add a request header (content is compressed) using SetRequestHeader:
          hn = 'Content-Encoding'
          hv = 'gzip'
          z  = setRequestHeader(httpHandle,hn,hv)


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Tony Gravagno
Sent: Friday, 26 August 2011 08:53
To: u2-users@listserver.u2ug.org
Subject: 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



_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to