GET Method

Sending a Request Message using the Hypertext Transfer Protocol (HTTP) GET Method

The GET Method

GET  WebAddress  HTTP-Version

The Request Headers and Request Message Body are both optional when using the GET method.

In order to use the GET method type with Quorum we will have to use the "Libraries.Network.NetworkRequest" library. Then we will create a NetworkRequestType "type" which we will set to GET as shown below:

use Libraries.Network.NetworkRequest
use Libraries.Network.NetworkRequestType

class Main
   action Main
        //creates a NetworkRequestType object "type"and sets "type" to
        //the GET method
       NetworkRequestType type
       type:SetToGet()

We will then create a NetworkRequest object "request" and set its RequestType to "type" (GET) as shown below:

        //creates a NetworkRequest object "request" and uses "type"
        //(which is already set to GET) as the parameter in
        //SetRequestType()
       NetworkRequest request
       request:SetRequestType(type)

Here is the complete code section to set the RequestType to GET and then return the RequestType as output to the screen:

use Libraries.Network.NetworkRequest
use Libraries.Network.NetworkRequestType

class Main
   action Main
       NetworkRequest request
       NetworkRequestType type
       type:SetToGet()
       request:SetRequestType(type)
       output request:GetRequestType()
   end
end

The output should look like this letting us know that our NetworkRequestType (method) is set to GET:

GET

Next Tutorial

In the next tutorial, we will discuss the POST Method, which describes an introduction to sending a request message using the Hypertext Transfer Protocol (HTTP) POST Method..