/// <summary> /// Responds with the given response body (from a <see cref="IResource"/>) and headers. The response status code is HTTP 200 (OK). /// </summary> /// <param name="requestActions">The <see cref="IRequestActions"/> to set up response on.</param> /// <param name="body">The <see cref="IResource"/> containing the body of the response.</param> /// <param name="headers">The response headers.</param> public static void AndRespondWith(this IRequestActions requestActions, IResource body, HttpHeaders headers) { requestActions.AndRespond(ResponseCreators.CreateWith(body, headers, HttpStatusCode.OK, "OK")); }
/// <summary> /// Responds with the given response body (from a <see cref="IResource"/>), headers, status code, and status description. /// </summary> /// <param name="requestActions">The <see cref="IRequestActions"/> to set up response on.</param> /// <param name="body">The <see cref="IResource"/> containing the body of the response.</param> /// <param name="headers">The response headers.</param> /// <param name="statusCode">The response status code.</param> /// <param name="statusDescription">The response status description.</param> public static void AndRespondWith(this IRequestActions requestActions, IResource body, HttpHeaders headers, HttpStatusCode statusCode, string statusDescription) { requestActions.AndRespond(ResponseCreators.CreateWith(body, headers, statusCode, statusDescription)); }