/// <summary> /// Sets the response body and the matching Content-Type header using <see cref="IHttpBodyConverter"/>. /// </summary> /// <param name="httpBodyConverter">Custom http body converter.</param> /// <returns>Returns this <see cref="ResponseBuilder"/> for futher customizations.</returns> public ResponseBuilder Body(IHttpBodyConverter httpBodyConverter) { _body = httpBodyConverter.Body; Header("Content-Type", httpBodyConverter.ContentType); return(this); }
/// <summary> /// Sets the request body and the matching Content-Type header using <see cref="IHttpBodyConverter"/>. /// </summary> /// <param name="httpBodyConverter">Custom http body converter.</param> /// <returns>Returns this <see cref="RequestMatcherBuilder"/> for futher customizations.</returns> public RequestMatcherBuilder Body(IHttpBodyConverter httpBodyConverter) { _body = new FieldMatcher(httpBodyConverter.Body); Header(CONTENT_TYPE, httpBodyConverter.ContentType); return(this); }
/// <summary> /// Builds a 200 response with a <see cref="IHttpBodyConverter"/>. /// </summary> /// <param name="httpBodyConverter"></param> /// <returns>Returns <see cref="ResponseBuilder"/> with the given arguments set.</returns> public static ResponseBuilder Success(IHttpBodyConverter httpBodyConverter) { return(ResponseBuilder.Response() .Status(HttpStatusCode.OK) .Body(httpBodyConverter)); }