I am using the refit library to call an external API. I am trying to figure out how to send a PATCH request. Can I set the fields that I am not updating to null?
public class User {
public string FirstName { get; set; }
public string LastName{ get; set; }
}
[Patch("/rest/user/{userId}")]
Task<ApiResponse<UserResponseApiModel>> UpdateUser(string userId, [Body] User user);
In the above example, how should I send the PATCH request if I need to update only the FirstName. Can I send the user model with LastName set to null?
I tried referring the documentation for refit, no luck there.