Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Delivered
Workspace IBM i
Categories Db2 for i
Created by Guest
Created on Mar 4, 2021

SQL's HTTPxxxx-Functions should provide body data of the response

It is great that we can consume webservices with SQL functions.

I have to consume a REST web service that answers in the case of an error with HTTP response code 401 and a JSON object with "error" and "error_desc" in the body of the response telling what the exact cause of the error was.

SQL seems to read the body of the HTTP response only when there is no error, so i have no access to these 2 values.

So i have to use another technique to buffer the response locally in a string and read the JSON object from the string. I found no SQL function that would provide me the data in the case of an HTTP error code.

The transmission of data in the body is a common practice, otherwise there were no customizable error pages in the www.

You can use http://ag1965.bplaced.net/webservice.php for a HTTP response 401 and a JSON object in the body with "error" and "error_desc".

You can use http://ag1965.bplaced.net/webservice.php?user=IBM for a HTTP response 200 and a JSON object in the body with 3 values.

SQL's HTTPxxx functions should read and provide the body or the variables just as in case of HTTP response code 200.


Use Case:

SQL consuming a web service that sends data in the body of the response when an error occurs.


Idea priority Medium
  • Guest
    Reply
    |
    Mar 8, 2021

    IBM believes that the request described has been solved and is available with the existing http function implementation by using the includeErrorMessage header attribute.

    From https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzajq/rzajqhttpoverview.htm

    includeErrorMsg: If true, then HTTP verbose functions will return error information in the RESPONSEMSG column.