com.ibm.cics.server

Class HttpClientRequest



  • public class HttpClientRequest
    extends API
    This class provides the Java implementation of HTTP client requests related to the following CICS API commands:
    • WEB SEND SESSTOKEN
    • WEB WRITE SESSTOKEN.

    The constructor accepts METHOD and MEDIATYPE information. These values can be altered by setter methods before the send methods are used to send a client request to the server.

    The setter methods allow instance variables to be set in the HttpClientRequest object. These variables relate to the following options on the CICS API command WEB SEND SESSTOKEN:

    • METHOD
    • MEDIATYPE
    • CLOSE
    • NOCLOSE
    • EXPECT
    • PATH
    • URIMAP
    • CLICONVERET
    • NOCLICONVERT
    • QUERYSTRING
    • DOCDELETE
    • NODOCDELETE
    • AUTHENTICATE NONE
    • AUTHENTICATE BASIC

    Various send methods allow a document, an application buffer, data stored in a container or a chunked request to be sent to the server.

    Method writeHeader() allows the application to supply HTTP headers that will be sent with the client request.

    See Also:
    API for general restrictions on using the JCICS API.
    Since CICS TS version:
    3.1
    Since package version:
    1.0.0
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int NOTSET
      Constant - NOT SET
    • Constructor Summary

      Constructors 
      Constructor and Description
      HttpClientRequest(java.lang.String method)
      The METHOD is saved in the HttpClientRequest object for later use by the send methods.
      HttpClientRequest(java.lang.String method, java.lang.String mediaType)
      The METHOD and MEDIATYPE information is saved in the HttpClientRequest object for later use by the send methods.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void send(HttpSession session)
      Send an request without a body to the server.
      void sendChunk(HttpSession session, byte[] from)
      Send an application buffer to the server as part of a chunked request.
      void sendChunk(HttpSession session, java.lang.String from)
      Send an application buffer to the server as part of a chunked request.
      void sendContainer(HttpSession session, Container container)
      Send data stored in a container to the server.
      void sendDocument(HttpSession session, Document doc)
      Send a document to the server.
      void sendFrom(HttpSession session, byte[] from)
      Send an application buffer to the server.
      void sendFrom(HttpSession session, java.lang.String from)
      Send an application buffer to the server.
      void sendLastChunk(HttpSession session)
      Indicate that the chunked request is complete.
      void setActionExpect()
      Sets WEB SEND SESSTOKEN command option ACTION to EXPECT.
      void setAuthenticationBasic()
      Sets WEB SEND SESSTOKEN command option AUTHENTICATE to BASIC.This method also clears any user-name or password information already set by method setAuthenticationBasic(String userName, String password).
      void setAuthenticationBasic(java.lang.String userName, java.lang.String password)
      Sets WEB SEND SESSTOKEN command option AUTHENTICATE to BASIC and sets the WEB SEND SESSTOKEN command options USERNAME, USERNAMELEN, PASSWORD and PASSWORDLEN.
      void setAuthenticationNone()
      Sets WEB SEND SESSTOKEN command option AUTHENTICATE to NONE.
      void setCharacterset(java.lang.String characterset)
      Sets WEB SEND SESSTOKEN command option CHARACTERSET.
      void setClientConvert()
      Sets WEB SEND SESSTOKEN command option CLIENTCONV to CLICONVERT.
      void setClose()
      Sets WEB SEND SESSTOKEN command option CLOSESTATUS to CLOSE.
      void setDocDelete()
      Sets WEB SEND SESSTOKEN command option DOCSTATUS to DOCDELETE.
      void setMediaType(java.lang.String mediaType)
      Sets WEB SEND SESSTOKEN command option MEDIATYPE.
      void setMethodDelete()
      Sets WEB SEND SESSTOKEN command option METHOD to DELETE.
      void setMethodGet()
      Sets WEB SEND SESSTOKEN command option METHOD to GET.
      void setMethodHead()
      Sets WEB SEND SESSTOKEN command option METHOD to HEAD.
      void setMethodOptions()
      Sets WEB SEND SESSTOKEN command option METHOD to OPTIONS.
      void setMethodPatch()
      Sets WEB SEND SESSTOKEN command option METHOD to PATCH.
      void setMethodPost()
      Sets WEB SEND SESSTOKEN command option METHOD to POST.
      void setMethodPut()
      Sets WEB SEND SESSTOKEN command option METHOD to PUT.
      void setMethodTrace()
      Sets WEB SEND SESSTOKEN command option METHOD to TRACE.
      void setNoClientConvert()
      Sets WEB SEND SESSTOKEN command option CLIENTCONV to NOCLICONVERT.
      void setNoClose()
      Sets WEB SEND SESSTOKEN command option CLOSESTATUS to NOCLOSE.
      void setNoDocDelete()
      Sets WEB SEND SESSTOKEN command option DOCSTATUS to NODOCDELETE.
      void setPath(java.lang.String path)
      Sets WEB SEND SESSTOKEN command option PATH.
      void setQueryString(java.lang.String queryString)
      Sets WEB SEND SESSTOKEN command option QUERYSTRING.
      void setUrimap(java.lang.String urimap)
      Sets WEB SEND SESSTOKEN command option URIMAP.
      void writeHeader(HttpSession session, java.lang.String header, java.lang.String value)
      Add HTTP header information to the request This is equivalent to CICS API command WEB WRITE SESSTOKEN.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NOTSET

        public static final int NOTSET
        Constant - NOT SET
        Since CICS TS version:
        3.1
        Since package version:
        1.0.0
    • Constructor Detail

      • HttpClientRequest

        public HttpClientRequest(java.lang.String method)
        The METHOD is saved in the HttpClientRequest object for later use by the send methods. Valid methods are "POST", "GET", "HEAD", "PUT", "TRACE", "OPTIONS", "PATCH" and "DELETE". If the method is not one of these or the mediaType is invalid the error is not detected until one of the send methods is used to send the client request to the server.

        Parameters:
        method - is the METHOD to be used by the WEB SEND SESSTOKEN command
        Since CICS TS version:
        4.1
        Since package version:
        1.200.0
      • HttpClientRequest

        public HttpClientRequest(java.lang.String method,
                                 java.lang.String mediaType)
        The METHOD and MEDIATYPE information is saved in the HttpClientRequest object for later use by the send methods. Valid methods are "POST", "GET", "HEAD", "PUT", "TRACE", "OPTIONS", "PATCH" and "DELETE". If the method is not one of these or the mediaType is invalid the error is not detected until one of the send methods is used to send the client request to the server.

        Parameters:
        method - is the METHOD to be used by the WEB SEND SESSTOKEN command
        mediaType - is the MEDIATYPE value to be used by the WEB SEND SESSTOKEN command
        Since CICS TS version:
        3.1
        Since package version:
        1.0.0