× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



In a URL many characters must be escaped. See https://en.wikipedia.org/wiki/Percent-encoding <https://en.wikipedia.org/wiki/Percent-encoding> for example.

Not hard to write a translator but Giovanni has one as part of the CGIDEV2 package. You can find the details of UrlUnEscSeq on this page: https://www.easy400.net/cgidev2o/exhibit5.htm <https://www.easy400.net/cgidev2o/exhibit5.htm>

There are probably other libraries out there that offer this capability.


Jon Paris.


On Feb 1, 2021, at 4:51 PM, Brian <belstsrv@xxxxxxxxx> wrote:

Hello All,

I am working on a project to create a web service to do some basic CRUD stuff to a file. This is more of a proof of concept to create a roadmap to web service front end a bunch of maintenance programs in the future.

I am creating a REST web service but in this case, when performing an update or insert, the JSON payload of the record is coming via a query parm versus in the body data itself. I've followed some online examples and I am able to successfully pull the QUERY_STRING environment variable and extract out the bits that I need.

My issue lies in that when I get the JSON data, it's encoded.

So, instead of this (just a snippet for example purposes):
{"EPNAME":"ZZ:ValleyGreen"

I get this:
%7B%22EPNAME%22%3A%22ZZ%3AValleyGreen%22

When I later try and take the JSON and blow it in to a data structure using data-into, it fails.

Am I doing something wrong? If sent via the normal body of the post/put, would it still be escaped? I can push for that to be changed if it makes life easier, I am just sort of working within s framework provided to me. Or perhaps it just needs escaped to the readable format before trying data-into?

Thanks for any guidance you can provide.

Brian
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.