本文整理汇总了C#中HTTPRequestHandle类的典型用法代码示例。如果您正苦于以下问题:C# HTTPRequestHandle类的具体用法?C# HTTPRequestHandle怎么用?C# HTTPRequestHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HTTPRequestHandle类属于命名空间,在下文中一共展示了HTTPRequestHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetHTTPRequestHeaderValue
/// <summary>
/// <para> Set a request header value for the request, must be called prior to sending the request. Will</para>
/// <para> return false if the handle is invalid or the request is already sent.</para>
/// </summary>
public static bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, string pchHeaderValue) {
InteropHelp.TestIfAvailableClient();
using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName))
using (var pchHeaderValue2 = new InteropHelp.UTF8StringHandle(pchHeaderValue)) {
return NativeMethods.ISteamHTTP_SetHTTPRequestHeaderValue(hRequest, pchHeaderName2, pchHeaderValue2);
}
}
示例2: SetHTTPRequestGetOrPostParameter
/// <summary>
/// <para> Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified</para>
/// <para> when creating the request. Must be called prior to sending the request. Will return false if the</para>
/// <para> handle is invalid or the request is already sent.</para>
/// </summary>
public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, string pchParamName, string pchParamValue) {
InteropHelp.TestIfAvailableGameServer();
using (var pchParamName2 = new InteropHelp.UTF8StringHandle(pchParamName))
using (var pchParamValue2 = new InteropHelp.UTF8StringHandle(pchParamValue)) {
return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestGetOrPostParameter(hRequest, pchParamName2, pchParamValue2);
}
}
示例3: GetHTTPResponseHeaderValue
public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize)
{
InteropHelp.TestIfAvailableGameServer();
bool result;
using (InteropHelp.UTF8StringHandle uTF8StringHandle = new InteropHelp.UTF8StringHandle(pchHeaderName))
{
result = NativeMethods.ISteamGameServerHTTP_GetHTTPResponseHeaderValue(hRequest, uTF8StringHandle, pHeaderValueBuffer, unBufferSize);
}
return result;
}
示例4: SetHTTPRequestHeaderValue
public bool SetHTTPRequestHeaderValue(HTTPRequestHandle request, string headerName, string headerValue)
{
CheckIfUsable();
using (NativeString nativeHeaderName = new NativeString(headerName))
{
using (NativeString nativeHeaderValue = new NativeString(headerValue))
{
return NativeMethods.HTTP_SetHTTPRequestHeaderValue(request.AsUInt32, nativeHeaderName.ToNativeAsUtf8(), nativeHeaderValue.ToNativeAsUtf8());
}
}
}
示例5: GetHTTPStreamingResponseBodyData
/// <summary>
/// <para> Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the</para>
/// <para> handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset</para>
/// <para> do not match the size and offset sent in HTTPRequestDataReceived_t.</para>
/// </summary>
public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamGameServerHTTP_GetHTTPStreamingResponseBodyData(hRequest, cOffset, pBodyDataBuffer, unBufferSize);
}
示例6: GetHTTPResponseBodySize
/// <summary>
/// <para> Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the</para>
/// <para> handle is invalid.</para>
/// </summary>
public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint unBodySize) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamGameServerHTTP_GetHTTPResponseBodySize(hRequest, out unBodySize);
}
示例7: ISteamGameServerHTTP_SetHTTPRequestRequiresVerifiedCertificate
public static extern bool ISteamGameServerHTTP_SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, [MarshalAs(UnmanagedType.I1)] bool bRequireVerifiedCertificate);
示例8: SetHTTPRequestNetworkActivityTimeout
/// <summary>
/// <para> Set a timeout in seconds for the HTTP request, must be called prior to sending the request. Default</para>
/// <para> timeout is 60 seconds if you don't call this. Returns false if the handle is invalid, or the request</para>
/// <para> has already been sent.</para>
/// </summary>
public static bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint unTimeoutSeconds) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestNetworkActivityTimeout(hRequest, unTimeoutSeconds);
}
示例9: GetHTTPRequestWasTimedOut
/// <summary>
/// <para> Check if the reason the request failed was because we timed it out (rather than some harder failure)</para>
/// </summary>
public static bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, out bool pbWasTimedOut) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamGameServerHTTP_GetHTTPRequestWasTimedOut(hRequest, out pbWasTimedOut);
}
示例10: SetHTTPRequestRequiresVerifiedCertificate
/// <summary>
/// <para> Set that https request should require verified SSL certificate via machines certificate trust store</para>
/// </summary>
public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestRequiresVerifiedCertificate(hRequest, bRequireVerifiedCertificate);
}
示例11: SetHTTPRequestCookieContainer
/// <summary>
/// <para> Set the cookie container to use for a HTTP request</para>
/// </summary>
public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestCookieContainer(hRequest, hCookieContainer);
}
示例12: SetHTTPRequestHeaderValue
// 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.
public static bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, string pchHeaderValue) {
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamHTTP_SetHTTPRequestHeaderValue(hRequest, pchHeaderName, pchHeaderValue);
}
示例13: SetHTTPRequestRawPostBody
// 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.
public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string pchContentType, byte[] pubBody, uint unBodyLen) {
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamHTTP_SetHTTPRequestRawPostBody(hRequest, pchContentType, pubBody, unBodyLen);
}
示例14: GetHTTPResponseBodyData
// 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.
public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize) {
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamHTTP_GetHTTPResponseBodyData(hRequest, pBodyDataBuffer, unBufferSize);
}
示例15: ISteamHTTP_SetHTTPRequestContextValue
public static extern bool ISteamHTTP_SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong ulContextValue);