Using IWS I have a RESTful web service.

If some of the business validation fails for the request I return either a 403 or a 409. However, when setting a 4xx or 5xx status the output is not returned to the client.

Is there a way for me to communicate the reason for the failure (ie "Concurrent request not allowed", "Invalid User", "Not authorized for this action", "Record already approved") back to the client while still using those status codes?

My fallback plan is to return 200 Ok with output parameters with a generic status field ("success"/"fail"/"error") and message field that would indicate the reason for failure or error.

Mitch Gallman | U.S. Xpress, Inc.
IBM i Applications Developer


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.