Libraries.Network.NetworkRequestType Documentation

This class is used with the NetworkRequest class to represent the type of request to make over the internet protocol. More information on the internet protocol, called Hyper Text Transfer Protocol (HTTP) can be found at: https://www.w3.org/Protocols/. The class is primarily used internally by the NetworkRequest class.

Example Code

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

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

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetHashCode()This action gets the hash code for an object.
GetType()This method returns the request type.
IsDelete()This method returns a boolean value true if the type of the network request is DELETE and false otherwise.
IsGet()This method returns a boolean value true if the type of the network request is GET and false otherwise.
IsHead()This method returns a boolean value true if the type of the network request is HEAD and false otherwise.
IsPatch()This method returns a boolean value true if the type of the network request is PATCH and false otherwise.
IsPost()This method returns a boolean value true if the type of the network request is POST and false otherwise.
IsPut()This method returns a boolean value true if the type of the network request is IsPUT and false otherwise.
SetToDelete()This method sets the request type to DELETE.
SetToGet()This method sets the request type to GET.
SetToHead()This method sets the request type to HEAD.
SetToPatch()This method sets the request type to PATCH.
SetToPost()This method sets the request type to POST.
SetToPut()This method sets the request type to PUT.
ToText()This method returns the NetworkRequestType value as text.

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetType()

This method returns the request type.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToGet()
            output type:GetType()
        end
    end

Return

integer: An integer indicating the type of the request.

IsDelete()

This method returns a boolean value true if the type of the network request is DELETE and false otherwise.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToDelete()
            output type:IsDelete()
        end
    end

Return

boolean: A boolean value based on the value of the type.

IsGet()

This method returns a boolean value true if the type of the network request is GET and false otherwise.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToGet()
            output type:IsGet()
        end
    end

Return

boolean: A boolean value based on the value of the type.

IsHead()

This method returns a boolean value true if the type of the network request is HEAD and false otherwise.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToHead()
            output type:IsHead()
        end
    end

Return

boolean: A boolean value based on the value of the type.

IsPatch()

This method returns a boolean value true if the type of the network request is PATCH and false otherwise.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToPatch()
            output type:IsHead()
        end
    end

Return

boolean: A boolean value based on the value of the type.

IsPost()

This method returns a boolean value true if the type of the network request is POST and false otherwise.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToPost()
            output type:IsPost()
        end
    end

Return

boolean: A boolean value based on the value of the type.

IsPut()

This method returns a boolean value true if the type of the network request is IsPUT and false otherwise.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToPut()
            output type:IsPut()
        end
    end

Return

boolean: A boolean value based on the value of the type.

SetToDelete()

This method sets the request type to DELETE.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToDelete()
        end
    end

SetToGet()

This method sets the request type to GET.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToGet()
        end
    end

SetToHead()

This method sets the request type to HEAD.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToHead()
        end
    end

SetToPatch()

This method sets the request type to PATCH.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToPatch()
        end
    end

SetToPost()

This method sets the request type to POST.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToPost()
        end
    end

SetToPut()

This method sets the request type to PUT.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToPut()
        end
    end

ToText()

This method returns the NetworkRequestType value as text.

Example Code

use Libraries.Network.NetworkRequestType

    class main
        action Main
            NetworkRequestType type
            type:SetToGet()
            output type:ToText()
        end
    end

Return

text: The NetworkRequestType value as text.