@@ -24,7 +24,18 @@ public sealed class HttpResponseMessageBuilder
2424 /// </summary>
2525 /// <param name="httpVersion">The <see cref="HttpVersion"/> of the response.</param>
2626 /// <returns>The <see cref="HttpResponseMessageBuilder"/> for further building of the response.</returns>
27+ [ Obsolete ( "Renamed to WithHttpVersion." , true ) ]
2728 public HttpResponseMessageBuilder WithVersion ( Version httpVersion )
29+ {
30+ return WithHttpVersion ( httpVersion ) ;
31+ }
32+
33+ /// <summary>
34+ /// Specifies the version of the response.
35+ /// </summary>
36+ /// <param name="httpVersion">The <see cref="HttpVersion"/> of the response.</param>
37+ /// <returns>The <see cref="HttpResponseMessageBuilder"/> for further building of the response.</returns>
38+ public HttpResponseMessageBuilder WithHttpVersion ( Version httpVersion )
2839 {
2940 httpResponseMessage . Version = httpVersion ;
3041 return this ;
@@ -35,7 +46,18 @@ public HttpResponseMessageBuilder WithVersion(Version httpVersion)
3546 /// </summary>
3647 /// <param name="statusCode">The <see cref="HttpStatusCode"/> of the response.</param>
3748 /// <returns>The <see cref="HttpResponseMessageBuilder"/> for further building of the response.</returns>
38- public HttpResponseMessageBuilder WithStatusCode ( HttpStatusCode statusCode )
49+ [ Obsolete ( "Renamed to WithHttpStatusCode." , true ) ]
50+ public HttpResponseMessageBuilder WithStatusCode ( HttpStatusCode httpStatusCode )
51+ {
52+ return WithHttpStatusCode ( httpStatusCode ) ;
53+ }
54+
55+ /// <summary>
56+ /// Specifies the status code of the response.
57+ /// </summary>
58+ /// <param name="statusCode">The <see cref="HttpStatusCode"/> of the response.</param>
59+ /// <returns>The <see cref="HttpResponseMessageBuilder"/> for further building of the response.</returns>
60+ public HttpResponseMessageBuilder WithHttpStatusCode ( HttpStatusCode statusCode )
3961 {
4062 httpResponseMessage . StatusCode = statusCode ;
4163 return this ;
@@ -46,7 +68,18 @@ public HttpResponseMessageBuilder WithStatusCode(HttpStatusCode statusCode)
4668 /// </summary>
4769 /// <param name="responseHeaderBuilder">The builder for configuring the response headers.</param>
4870 /// <returns>The <see cref="HttpResponseMessageBuilder"/> for further building of the response.</returns>
71+ [ Obsolete ( "Renamed to WithResponseHeaders." , true ) ]
4972 public HttpResponseMessageBuilder WithHeaders ( Action < HttpResponseHeaders > responseHeaderBuilder )
73+ {
74+ return WithResponseHeaders ( responseHeaderBuilder ) ;
75+ }
76+
77+ /// <summary>
78+ /// Configure request headers using a builder by directly accessing the <see cref="HttpResponseHeaders"/>.
79+ /// </summary>
80+ /// <param name="responseHeaderBuilder">The builder for configuring the response headers.</param>
81+ /// <returns>The <see cref="HttpResponseMessageBuilder"/> for further building of the response.</returns>
82+ public HttpResponseMessageBuilder WithResponseHeaders ( Action < HttpResponseHeaders > responseHeaderBuilder )
5083 {
5184 if ( responseHeaderBuilder == null )
5285 {
@@ -63,7 +96,19 @@ public HttpResponseMessageBuilder WithHeaders(Action<HttpResponseHeaders> respon
6396 /// <param name="header">The name of the header to add.</param>
6497 /// <param name="value">The value of the header to add.</param>
6598 /// <returns>The <see cref="HttpResponseMessageBuilder"/> for further building of the response.</returns>
99+ [ Obsolete ( "Renamed to WithResponseHeader." , true ) ]
66100 public HttpResponseMessageBuilder WithHeader ( string header , string value )
101+ {
102+ return WithResponseHeader ( header , value ) ;
103+ }
104+
105+ /// <summary>
106+ /// Adds a request header to the response.
107+ /// </summary>
108+ /// <param name="header">The name of the header to add.</param>
109+ /// <param name="value">The value of the header to add.</param>
110+ /// <returns>The <see cref="HttpResponseMessageBuilder"/> for further building of the response.</returns>
111+ public HttpResponseMessageBuilder WithResponseHeader ( string header , string value )
67112 {
68113 if ( string . IsNullOrEmpty ( header ) )
69114 {
0 commit comments