1515namespace RestSharp ;
1616
1717public static partial class RestRequestExtensions {
18-
1918 /// <summary>
2019 /// Adds a URL segment parameter to the request. The resource URL must have a placeholder for the parameter for it to work.
2120 /// For example, if you add a URL segment parameter with the name "id", the resource URL should contain {id} in its path.
2221 /// </summary>
2322 /// <param name="request">Request instance</param>
24- /// <param name="name">Name of the parameter, must be matching a placeholder in the resource URL as {name}</param>
23+ /// <param name="name">Name of the parameter; must be matching a placeholder in the resource URL as {name}</param>
2524 /// <param name="value">Value of the parameter</param>
2625 /// <param name="encode">Encode the value or not, default true</param>
2726 /// <returns></returns>
28- public static RestRequest AddUrlSegment ( this RestRequest request , string name , string value , bool encode = true )
27+ public static RestRequest AddUrlSegment ( this RestRequest request , string name , string ? value , bool encode = true )
2928 => request . AddParameter ( new UrlSegmentParameter ( name , value , encode ) ) ;
3029
3130 /// <summary>
3231 /// Adds a URL segment parameter to the request. The resource URL must have a placeholder for the parameter for it to work.
3332 /// For example, if you add a URL segment parameter with the name "id", the resource URL should contain {id} in its path.
3433 /// </summary>
3534 /// <param name="request">Request instance</param>
36- /// <param name="name">Name of the parameter, must be matching a placeholder in the resource URL as {name}</param>
35+ /// <param name="name">Name of the parameter; must be matching a placeholder in the resource URL as {name}</param>
3736 /// <param name="value">Value of the parameter</param>
3837 /// <param name="encode">Encode the value or not, default true</param>
3938 /// <returns></returns>
4039 public static RestRequest AddUrlSegment < T > ( this RestRequest request , string name , T value , bool encode = true ) where T : struct
41- => request . AddUrlSegment ( name , Ensure . NotNull ( value . ToString ( ) , nameof ( value ) ) , encode ) ;
40+ => request . AddUrlSegment ( name , value . ToString ( ) , encode ) ;
4241}
0 commit comments