asp.net web API HTTP PUT method

前端 未结 2 787
不思量自难忘°
不思量自难忘° 2021-01-23 16:59

I have some resource- UserProfile

public UserProfile
{
   public string Email{get;set;}
   public string Password{get;set;}
}

I want to change

2条回答
  •  感情败类
    2021-01-23 17:39

    You have two options for updating email and password separately.

    A) Don't use PUT, use POST

    B) Create child resources for updating the individual elements, e.g.

    PUT /api/user/123/email
    

    And

    PUT /api/user/123/password
    

提交回复
热议问题