예제 #1
0
 private static void ReplayNoMapping(IMockHttpResponse response)
 {
     response
     .SetStatusCode(HttpStatusCode.NotImplemented)
     .SetStringContent(
         "Proxy works in replay mode and no mapping is specified for this request.",
         Encoding.UTF8,
         "text");
 }
예제 #2
0
        private void Replay(IMockHttpResponse rsp, ITestableHttpResponse response)
        {
            rsp.SetStatusCode(response.StatusCode)
            .SetHeaders(response.Headers.Where(kv => !InvalidHeaders.Contains(kv.Key)));

            if (response.Content.ContentLength > 0)
            {
                rsp.SetContent(
                    response.Content.Content,
                    response.Content.ContentEncoding,
                    response.Content.ContentType);
            }
        }