本文整理汇总了C#中Response.SetPayload方法的典型用法代码示例。如果您正苦于以下问题:C# Response.SetPayload方法的具体用法?C# Response.SetPayload怎么用?C# Response.SetPayload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Response
的用法示例。
在下文中一共展示了Response.SetPayload方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Respond
/// <summary>
/// Responds with the specified response code, payload and content-type.
/// </summary>
public void Respond(StatusCode code, String payload, Int32 contentType)
{
Response response = new Response(code);
response.SetPayload(payload, contentType);
Respond(response);
}
示例2: ProcessPOST
private void ProcessPOST(Exchange exchange)
{
String payload = exchange.Request.PayloadString;
if (_test.request_short)
Assert.AreEqual(payload, SHORT_POST_REQUEST);
else
Assert.AreEqual(payload, LONG_POST_REQUEST);
Response response = new Response(StatusCode.Changed);
if (_test.respond_short)
response.SetPayload(SHORT_POST_RESPONSE);
else
response.SetPayload(LONG_POST_RESPONSE);
exchange.SendResponse(response);
}
示例3: ProcessGET
private void ProcessGET(Exchange exchange)
{
Response response = new Response(StatusCode.Content);
if (_test.respond_short)
response.SetPayload(SHORT_GET_RESPONSE);
else response.SetPayload(LONG_GET_RESPONSE);
exchange.SendResponse(response);
}