public AddRequestBuilder ( |
||
requestBuilder | ||
리턴 | void |
public void SettingAnAcceptHeaderShouldBePassedToTheRequest() { var link = new Link { Target = new Uri("Http://localhost"), }; link.AddRequestBuilder(new InlineRequestBuilder((r) => { r.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/vnd.hal")); r.Headers.UserAgent.Add(new ProductInfoHeaderValue("foo", "1.1")); return r; })); var request = link.CreateRequest(); Assert.True(request.Headers.Accept.Any(h => h.MediaType == "application/vnd.hal")); }