Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | List of all members
Steamworks.SteamGameServerHTTP Class Reference

Static Public Member Functions

static HTTPCookieContainerHandle CreateCookieContainer (bool bAllowResponsesToModify)
 
static HTTPRequestHandle CreateHTTPRequest (EHTTPMethod eHTTPRequestMethod, string pchAbsoluteURL)
 
static bool DeferHTTPRequest (HTTPRequestHandle hRequest)
 
static bool GetHTTPDownloadProgressPct (HTTPRequestHandle hRequest, out float pflPercentOut)
 
static bool GetHTTPRequestWasTimedOut (HTTPRequestHandle hRequest, out bool pbWasTimedOut)
 
static bool GetHTTPResponseBodyData (HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize)
 
static bool GetHTTPResponseBodySize (HTTPRequestHandle hRequest, out uint unBodySize)
 
static bool GetHTTPResponseHeaderSize (HTTPRequestHandle hRequest, string pchHeaderName, out uint unResponseHeaderSize)
 
static bool GetHTTPResponseHeaderValue (HTTPRequestHandle hRequest, string pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize)
 
static bool GetHTTPStreamingResponseBodyData (HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize)
 
static bool PrioritizeHTTPRequest (HTTPRequestHandle hRequest)
 
static bool ReleaseCookieContainer (HTTPCookieContainerHandle hCookieContainer)
 
static bool ReleaseHTTPRequest (HTTPRequestHandle hRequest)
 
static bool SendHTTPRequest (HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle)
 
static bool SendHTTPRequestAndStreamResponse (HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle)
 
static bool SetCookie (HTTPCookieContainerHandle hCookieContainer, string pchHost, string pchUrl, string pchCookie)
 
static bool SetHTTPRequestAbsoluteTimeoutMS (HTTPRequestHandle hRequest, uint unMilliseconds)
 
static bool SetHTTPRequestContextValue (HTTPRequestHandle hRequest, ulong ulContextValue)
 
static bool SetHTTPRequestCookieContainer (HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer)
 
static bool SetHTTPRequestGetOrPostParameter (HTTPRequestHandle hRequest, string pchParamName, string pchParamValue)
 
static bool SetHTTPRequestHeaderValue (HTTPRequestHandle hRequest, string pchHeaderName, string pchHeaderValue)
 
static bool SetHTTPRequestNetworkActivityTimeout (HTTPRequestHandle hRequest, uint unTimeoutSeconds)
 
static bool SetHTTPRequestRawPostBody (HTTPRequestHandle hRequest, string pchContentType, byte[] pubBody, uint unBodyLen)
 
static bool SetHTTPRequestRequiresVerifiedCertificate (HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate)
 
static bool SetHTTPRequestUserAgentInfo (HTTPRequestHandle hRequest, string pchUserAgentInfo)
 

Member Function Documentation

static HTTPCookieContainerHandle Steamworks.SteamGameServerHTTP.CreateCookieContainer ( bool  bAllowResponsesToModify)
inlinestatic

Creates a cookie container handle which you must later free with ReleaseCookieContainer(). If bAllowResponsesToModify=true

than any response to your requests using this cookie container may add new cookies which may be transmitted with

future requests. If bAllowResponsesToModify=false than only cookies you explicitly set will be sent. This API is just for

during process lifetime, after steam restarts no cookies are persisted and you have no way to access the cookie container across

repeat executions of your process.

static HTTPRequestHandle Steamworks.SteamGameServerHTTP.CreateHTTPRequest ( EHTTPMethod  eHTTPRequestMethod,
string  pchAbsoluteURL 
)
inlinestatic

Initializes a new HTTP request, returning a handle to use in further operations on it. Requires

the method (GET or POST) and the absolute URL for the request. Both http and https are supported,

so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/

or such.

static bool Steamworks.SteamGameServerHTTP.DeferHTTPRequest ( HTTPRequestHandle  hRequest)
inlinestatic

Defers a request you have sent, the actual HTTP client code may have many requests queued, and this will move

the specified request to the tail of the queue. Returns false on invalid handle, or if the request is not yet sent.

static bool Steamworks.SteamGameServerHTTP.GetHTTPDownloadProgressPct ( HTTPRequestHandle  hRequest,
out float  pflPercentOut 
)
inlinestatic

Gets progress on downloading the body for the request. This will be zero unless a response header has already been

received which included a content-length field. For responses that contain no content-length it will report

zero for the duration of the request as the size is unknown until the connection closes.

static bool Steamworks.SteamGameServerHTTP.GetHTTPRequestWasTimedOut ( HTTPRequestHandle  hRequest,
out bool  pbWasTimedOut 
)
inlinestatic

Check if the reason the request failed was because we timed it out (rather than some harder failure)

static bool Steamworks.SteamGameServerHTTP.GetHTTPResponseBodyData ( HTTPRequestHandle  hRequest,
byte[]  pBodyDataBuffer,
uint  unBufferSize 
)
inlinestatic

Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the

handle is invalid or is to a streaming response, or if the provided buffer is not the correct size. Use BGetHTTPResponseBodySize first to find out

the correct buffer size to use.

static bool Steamworks.SteamGameServerHTTP.GetHTTPResponseBodySize ( HTTPRequestHandle  hRequest,
out uint  unBodySize 
)
inlinestatic

Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the

handle is invalid.

static bool Steamworks.SteamGameServerHTTP.GetHTTPResponseHeaderSize ( HTTPRequestHandle  hRequest,
string  pchHeaderName,
out uint  unResponseHeaderSize 
)
inlinestatic

Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also

returns the size of the header value if present so the caller and allocate a correctly sized buffer for

GetHTTPResponseHeaderValue.

static bool Steamworks.SteamGameServerHTTP.GetHTTPResponseHeaderValue ( HTTPRequestHandle  hRequest,
string  pchHeaderName,
byte[]  pHeaderValueBuffer,
uint  unBufferSize 
)
inlinestatic

Gets header values from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the

header is not present or if your buffer is too small to contain it's value. You should first call

BGetHTTPResponseHeaderSize to check for the presence of the header and to find out the size buffer needed.

static bool Steamworks.SteamGameServerHTTP.GetHTTPStreamingResponseBodyData ( HTTPRequestHandle  hRequest,
uint  cOffset,
byte[]  pBodyDataBuffer,
uint  unBufferSize 
)
inlinestatic

Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the

handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset

do not match the size and offset sent in HTTPRequestDataReceived_t.

static bool Steamworks.SteamGameServerHTTP.PrioritizeHTTPRequest ( HTTPRequestHandle  hRequest)
inlinestatic

Prioritizes a request you have sent, the actual HTTP client code may have many requests queued, and this will move

the specified request to the head of the queue. Returns false on invalid handle, or if the request is not yet sent.

static bool Steamworks.SteamGameServerHTTP.ReleaseCookieContainer ( HTTPCookieContainerHandle  hCookieContainer)
inlinestatic

Release a cookie container you are finished using, freeing it's memory

static bool Steamworks.SteamGameServerHTTP.ReleaseHTTPRequest ( HTTPRequestHandle  hRequest)
inlinestatic

Releases an HTTP response handle, should always be called to free resources after receiving a HTTPRequestCompleted_t

callback and finishing using the response.

static bool Steamworks.SteamGameServerHTTP.SendHTTPRequest ( HTTPRequestHandle  hRequest,
out SteamAPICall_t  pCallHandle 
)
inlinestatic

Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on

asynchronous response via callback.

Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control

header and only do a local cache lookup rather than sending any actual remote request.

static bool Steamworks.SteamGameServerHTTP.SendHTTPRequestAndStreamResponse ( HTTPRequestHandle  hRequest,
out SteamAPICall_t  pCallHandle 
)
inlinestatic

Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on

asynchronous response via callback for completion, and listen for HTTPRequestHeadersReceived_t and

HTTPRequestDataReceived_t callbacks while streaming.

static bool Steamworks.SteamGameServerHTTP.SetCookie ( HTTPCookieContainerHandle  hCookieContainer,
string  pchHost,
string  pchUrl,
string  pchCookie 
)
inlinestatic

Adds a cookie to the specified cookie container that will be used with future requests.

static bool Steamworks.SteamGameServerHTTP.SetHTTPRequestAbsoluteTimeoutMS ( HTTPRequestHandle  hRequest,
uint  unMilliseconds 
)
inlinestatic

Set an absolute timeout on the HTTP request, this is just a total time timeout different than the network activity timeout

which can bump everytime we get more data

static bool Steamworks.SteamGameServerHTTP.SetHTTPRequestContextValue ( HTTPRequestHandle  hRequest,
ulong  ulContextValue 
)
inlinestatic

Set a context value for the request, which will be returned in the HTTPRequestCompleted_t callback after

sending the request. This is just so the caller can easily keep track of which callbacks go with which request data.

static bool Steamworks.SteamGameServerHTTP.SetHTTPRequestCookieContainer ( HTTPRequestHandle  hRequest,
HTTPCookieContainerHandle  hCookieContainer 
)
inlinestatic

Set the cookie container to use for a HTTP request

static bool Steamworks.SteamGameServerHTTP.SetHTTPRequestGetOrPostParameter ( HTTPRequestHandle  hRequest,
string  pchParamName,
string  pchParamValue 
)
inlinestatic

Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified

when creating the request. Must be called prior to sending the request. Will return false if the

handle is invalid or the request is already sent.

static bool Steamworks.SteamGameServerHTTP.SetHTTPRequestHeaderValue ( HTTPRequestHandle  hRequest,
string  pchHeaderName,
string  pchHeaderValue 
)
inlinestatic

Set a request header value for the request, must be called prior to sending the request. Will

return false if the handle is invalid or the request is already sent.

static bool Steamworks.SteamGameServerHTTP.SetHTTPRequestNetworkActivityTimeout ( HTTPRequestHandle  hRequest,
uint  unTimeoutSeconds 
)
inlinestatic

Set a timeout in seconds for the HTTP request, must be called prior to sending the request. Default

timeout is 60 seconds if you don't call this. Returns false if the handle is invalid, or the request

has already been sent.

static bool Steamworks.SteamGameServerHTTP.SetHTTPRequestRawPostBody ( HTTPRequestHandle  hRequest,
string  pchContentType,
byte[]  pubBody,
uint  unBodyLen 
)
inlinestatic

Sets the body for an HTTP Post request. Will fail and return false on a GET request, and will fail if POST params

have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType

parameter will set the content-type header for the request so the server may know how to interpret the body.

static bool Steamworks.SteamGameServerHTTP.SetHTTPRequestRequiresVerifiedCertificate ( HTTPRequestHandle  hRequest,
bool  bRequireVerifiedCertificate 
)
inlinestatic

Set that https request should require verified SSL certificate via machines certificate trust store

static bool Steamworks.SteamGameServerHTTP.SetHTTPRequestUserAgentInfo ( HTTPRequestHandle  hRequest,
string  pchUserAgentInfo 
)
inlinestatic

Set the extra user agent info for a request, this doesn't clobber the normal user agent, it just adds the extra info on the end


The documentation for this class was generated from the following file: