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



For more info, see thread below in link..

I have a POST created in IWS that has a struct (JSON) as an Input parameter. It also uses httpStatus, and httpHeaders. We also return 2 character messages. When everything is goes well, we return 200 and in the 'body' that is returned, we receive the contents of successMessage and errorMessage in JSON formats.

We've tried to add validation on say items and locations in the Order (JSON) struct before actually doing anything in the code. I was thinking we could set the httpStatus to 4xx, set errorMessage to some string, and IWS would return the errorMessage just like if 2xx. We don't seem to get anything back in the response.

Any thoughts? Thanks.

=======================================================================================

Procedure Interface...
Dcl-pi createOrder;
Order likeds(orderInfo);
httpStatus int(10);
httpHeaders char(100) dim(10);
successMessage char(100);
errorMessage char(100);
End-pi;

https://stackoverflow.com/questions/942951/rest-api-error-return-good-practices?noredirect=1&lq=1



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.