Simple SQL DB2 IBMi Webservice call

A simple example of how to call a webservice using IBMi DB2 SQL functions to return a joke in JSON format using HTTP_GET and HTTP_GET_VERBOSE.

select QSYS2.HTTP_GET('https://v2.jokeapi.dev/joke/Programming','{"sslTolerate": "true"}') from sysibm.sysdummy1;

select * from table(qsys2.http_Get_Verbose('https://v2.jokeapi.dev/joke/Programming','{"sslTolerate": "true"}')) x;

Alessandro Mattiuzzi

Swift Developer presso ECONORMA Sas | Comarch ERP Java Developer presso Progetto EDP Srl

10 个月

Hi, Thanks for ehe simple example. How can i add "bearer authorization" to header in the GET call? Thanks

回复
Rick Stephens

President at West Coast Casual Inc.

2 年

How is my longtime friend been doing recently? good I hope

回复

要查看或添加评论,请登录

Ricky Thompson的更多文章

  • Splitting a PDF with RPG and Java PDFBox based on Text

    Splitting a PDF with RPG and Java PDFBox based on Text

    So this is a follow up article to my previous example of just splitting each page of a PDF document. See the previous…

  • Splitting a PDF with RPG and Java PDFBox

    Splitting a PDF with RPG and Java PDFBox

    I saw a post on Facebook asking if there was a way to split a PDF. While the poster didn't specify how he was splitting…

    9 条评论
  • RPG End Code Blocks - VS Code Extension

    RPG End Code Blocks - VS Code Extension

    I have been trying to use VS Code - Code For IBMi more to get used to it. One of the things I missed in VS Code vs RDi…

    8 条评论
  • DB2 HTTP_POST

    DB2 HTTP_POST

    In the past when I was trying to learn how to use some webservices and there was a site that basically allowed you to…

    3 条评论
  • Using SQL Lateral

    Using SQL Lateral

    I think we have probably all seen a table that we wish was designed a little differently. Like lets take a…

    3 条评论
  • Part 3: Parsing Complex JSON Objects with DB2 SQL

    Part 3: Parsing Complex JSON Objects with DB2 SQL

    So this credit goes to Birgitta Hauser, I had e-mailed her prior to posting the last two articles asking for some help…

    10 条评论
  • Part 2: Parsing Complex JSON Objects with DB2 SQL

    Part 2: Parsing Complex JSON Objects with DB2 SQL

    In the previous article, it showed how to parse a complex JSON article but I wanted to add how you might process that…

    1 条评论
  • Parsing a Complex JSON with DB2

    Parsing a Complex JSON with DB2

    I recently needed to parse a pretty complex JSON object with DB2 SQL. This isn't the easiest thing in the world to do.

    5 条评论
  • ACS - Run SQL Scripts - Insert From Examples

    ACS - Run SQL Scripts - Insert From Examples

    I'm forever saving SQL Scripts from ACS to a PC file. Not that this is a bad habit or anything but finding them for…

    2 条评论
  • Generating the SQL DDL from an existing table

    Generating the SQL DDL from an existing table

    Every so often I see someone ask how they can generate the DDL from a Table, PF, View, or Procedure . Maybe the source…

    2 条评论

社区洞察

其他会员也浏览了