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

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.

Parameters

Return

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

Example

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

Equals(Libraries.Language.Object object)

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

Parameters

Return

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

Example

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

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetType()

This method returns the request type.

Return

integer: An integer indicating the type of the request.

Example

use Libraries.Network.NetworkRequestType

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

IsDelete()

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

Return

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

Example

use Libraries.Network.NetworkRequestType

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

IsGet()

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

Return

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

Example

use Libraries.Network.NetworkRequestType

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

IsHead()

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

Return

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

Example

use Libraries.Network.NetworkRequestType

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

IsPatch()

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

Return

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

Example

use Libraries.Network.NetworkRequestType

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

IsPost()

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

Return

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

Example

use Libraries.Network.NetworkRequestType

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

IsPut()

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

Return

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

Example

use Libraries.Network.NetworkRequestType

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

SetToDelete()

This method sets the request type to DELETE.

Example

use Libraries.Network.NetworkRequestType

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

SetToGet()

This method sets the request type to GET.

Example

use Libraries.Network.NetworkRequestType

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

SetToHead()

This method sets the request type to HEAD.

Example

use Libraries.Network.NetworkRequestType

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

SetToPatch()

This method sets the request type to PATCH.

Example

use Libraries.Network.NetworkRequestType

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

SetToPost()

This method sets the request type to POST.

Example

use Libraries.Network.NetworkRequestType

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

SetToPut()

This method sets the request type to PUT.

Example

use Libraries.Network.NetworkRequestType

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

ToText()

This method returns the NetworkRequestType value as text.

Return

text: The NetworkRequestType value as text.

Example

use Libraries.Network.NetworkRequestType

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