public async Task TestSerializeGetRequest() { var client = new FfClient(this.MockConfig()); var request = new HttpRequestMessage(HttpMethod.Get, "http://google.com"); var serialized = Encoding.UTF8.GetString(await client.SerializeHttpMessage(request)); Assert.Equal("GET / HTTP/1.1\nHost: google.com\n\n", serialized); }
public async Task TestSerializePostRequest() { var client = new FfClient(this.MockConfig()); var request = new HttpRequestMessage(HttpMethod.Post, "http://google.com") { Content = new ByteArrayContent(Encoding.UTF8.GetBytes("Body")) { Headers = { ContentLength = 4 } } }; var serialized = Encoding.UTF8.GetString(await client.SerializeHttpMessage(request)); Assert.Equal("POST / HTTP/1.1\nHost: google.com\nContent-Length: 4\n\nBody", serialized); }