Question How to post xml file with the data Base64 encoded

acejimmyster

New Member
Hi,
I'm using the OpenEdge 10.1C. I'm trying to create socket connection to post XML-formated data into one specific URL without using WebSpeed. There is data base64 encoded included in this XML-formated data and it should be saved in one variable with longchar type.

What should I do to URL encode this kind of data?
As I know ,the built-in function URL-ENCODE only recognize the data with char type, Even I could split this function out from the WebSpeed API, will the long char data encode by the URL-ENCODE function with char type input parameter?
 

medu

Member
you should not send that data in a GET request (parameters in query string) but as a POST, so there is no need to url-encode it
 

acejimmyster

New Member
Hi medu,
Thanks for your reply.But there are some special characters like "/","+" ,"=" will be recognized wrongly as posting parameter.
 

medu

Member
this is only if you send application/x-www-form-urlencoded post request (content type), normally since you send all data in XML form the content type of your request should probably be just text/xml and then the xml data can go directly into the body with no encoding - as the only 'parameter' sent for that request.
 

acejimmyster

New Member
Hi,
application/x-www-form-urlencoded is required in the post request.
Finally, I made a tiny change for that built-in function URL-ENCODE to make it could loop the each character in the longchar value.
 
Top