× 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.



Hi Peter/Nadir

Thank you for your email. I am trying to set up the webservices to return
response in JSON format only.

This can be done by putting http header as application /json or setting the
output media as JSON only. I have tried both scenarios.

Please find the document attached.

Thank you !

On Thu, May 23, 2019 at 12:52 PM Peter Dow <petercdow@xxxxxxxxx> wrote:

When you say "If I set the allow output media to (Json and XML)", do you
mean when you deploy the webserver?

If yes, then the client controls which format the response is in by
sending an http header of

Accept:application/json
or Accept:application/xml

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx>

/
On 5/22/2019 3:44 AM, anshul narang wrote:
Hi All

I have been trying to deploy restful services using IBM web admin for I.
I
have come acros peculiar situation with JSON.

I have set the allow output media as JSON . In the response I get the
\(escape characters ) with RAW as JSON.


- {\"headquarterNumber\":37 }


If I set the allow output media to (Json and XML) . The output is like
with
RAW as XML as below.


- {"headquarterNumber":37}


I have set headers as application json as well. It doenst resolve the
issue.

Please help me on this issue





---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.




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.