Rest Service Post Json containing Base64 encoded data
Posted: Wed Apr 19, 2023 7:24 pm
I'm using HTTPAPI to post to a rest service that requires one element to be base64 encoded and I'm running into a tranlation problem.
My json needs to be
{
"file":"base64encodedfilecontents",
"replace":"true",
"domain":"Default"
}
in my rpg program I'm reading a text file into a string then encode it using the base64_encode function. Then I put it together as shown above and post it with http_url_post. I get a 400 response - Unable to parse xml file: Content is not allowed in prolog.
how can I properly encode my request?
My json needs to be
{
"file":"base64encodedfilecontents",
"replace":"true",
"domain":"Default"
}
in my rpg program I'm reading a text file into a string then encode it using the base64_encode function. Then I put it together as shown above and post it with http_url_post. I get a 400 response - Unable to parse xml file: Content is not allowed in prolog.
how can I properly encode my request?