Download and Install HTTPAPI (LIBHTTP) for IBM i

HTTPAPI for IBM i (LIBHTTP) is a popular open-source library for making HTTP requests from RPG and other programming languages on the IBM i platform. 

Here’s a step-by-step guide on how to download and install HTTPAPI on your IBM i system:

1

Step 1 - Check your IBM i System Prerequisites

  • IBM i (OS/400) version 6.1 or later
  • TCP/IP must be installed and working
  • You need an ILE RPG compiler!

2

Step 2 - Download HTTPAPI

  • Visit the HTTPAPI Repository on Scott Klements Website: Go to the HTTPAPI page.
  • Alternatively Download My Mirror: Below this lesson you will see the version I use in the resources link. If Scott's website is offline for any reason, you can grab my copy instead.

3

Step 3 - Upload to your IBM i System

You have three main ways of uploading the SAVF to your IBM i system

1 - Use Scott's automated DOS BAT file to FTP upload

Switch to the directory where you unzipped HTTPAPI.ZIP

C:\ > cd \httpapi

Run the batch file. It will FTP to your IBM i System, create the LIBHTTP library, create the appropriate source files, and upload all of the source members. 

You have to pass parameters to tell it where your IBM i System is, including your userid and password:

C:\HTTPAPI > upload IBMiSYSTEMNAME MYUSER MYPASSWORD

2 - Use Scott's manual FTP upload process

Alternatively you can do a Manual Upload: Create the necessary objects on IBM i:


CRTLIB LIB(LIBHTTP)
CRTSRCPF FILE(LIBHTTP/QCLSRC) RCDLEN(92)
CRTSRCPF FILE(LIBHTTP/QDDSSRC) RCDLEN(92)
CRTSRCPF FILE(LIBHTTP/QCMDSRC) RCDLEN(92)
CRTSRCPF FILE(LIBHTTP/QRPGLESRC) RCDLEN(112)
CRTSRCPF FILE(LIBHTTP/QSH) RCDLEN(124)
CRTSRCPF FILE(LIBHTTP/QSRVSRC) RCDLEN(92)
CRTSRCPF FILE(LIBHTTP/QXMLGENS) RCDLEN(112)
CRTSRCPF FILE(LIBHTTP/EXPAT) RCDLEN(112)


Transfer all of the source code to IBM i


Open an MS-DOS Prompt.
Type: cd \directory\where\you\unzipped\httpapi
Type: ftp your-ibmi-name-here
Type: (enter your username & password when asked)
Type: quote site namefmt 1
Type: cd /qsys.lib/libhttp.lib
Type: prompt off
Type: ascii
Type: lcd QCLSRC.FILE
Type: cd QCLSRC.FILE
Type: mput *
Type: lcd ../QDDSSRC.FILE
Type: cd ..
Type: cd QDDSSRC.FILE
Type: mput *
Type: lcd ../QCMDSRC.FILE
Type: cd ..
Type: cd QCMDSRC.FILE
Type: mput *
Type: lcd ../QRPGLESRC.FILE
Type: cd ..
Type: cd QRPGLESRC.FILE
Type: mput *
Type: lcd ../QSH.FILE
Type: cd ..
Type: cd QSH.FILE
Type: mput *
Type: lcd ../QSRVSRC.FILE
Type: cd ..
Type: cd QSRVSRC.FILE
Type: mput *
Type: lcd ../QXMLGENS.FILE
Type: cd ..
Type: cd QXMLGENS.FILE
Type: mput *
Type: lcd ../EXPAT.FILE
Type: cd ..
Type: cd EXPAT.FILE
Type: mput *
Type: quit

4

Step 4 - Set Up the Environment

Add the Library to the Library List: Ensure that the library containing HTTPAPI is in your library list. You can do this by using the ADDLIBLE command: ADDLIBLE LIB(LIBHTTP)

5

Step 5 - Test the Installation

Run Sample ProgramsLIBHTTP usually comes with sample programs. You can run these to verify that the installation was successful. Look for sample programs in the source files and compile them similarly to how you compiled the main library.

By following these steps, you should be able to successfully download, install, and set up HTTPAPI for IBM i (LIBHTTP) on your IBM i system.

Resources

Resource 1

HTTPAPI for IBM i (LIBHTTP)

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>