AppHarbor.Test.Mocks.MockHttp.CreateHttpResponse C# (CSharp) Method

CreateHttpResponse() protected method

protected CreateHttpResponse ( HttpStatusCode statusCode, string location ) : HttpResponse
statusCode HttpStatusCode
location string
return RestSharp.HttpResponse
		protected HttpResponse CreateHttpResponse(HttpStatusCode statusCode, string location)
		{
			var encoding = Encoding.UTF8;
			var response = new HttpResponse
			{
				StatusCode = statusCode,
				ContentEncoding = "UTF8",
				ContentLength = 0,
				RawBytes = encoding.GetBytes(""),
				ContentType = "application/json",
			};

			if (location != null)
			{
				response.Headers.Add(new HttpHeader
				{
					Name = "Location",
					Value = location
				});
			}

			return response;
		}