Which REST operation (GET, PUT, or POST) for validating information?

后端 未结 4 1276
终归单人心
终归单人心 2020-12-29 05:12

My users enter a few information fields in an iOS app. This information must be validated on my server, which has a RESTful API. After validation the UI of the iOS app chang

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-29 05:39

    Google proposes use of Custom Methods for REST API

    For custom methods, they should use the following generic HTTP mapping:

    https://service.name/v1/some/resource/name:customVerb

    The reason to use : instead of / to separate the custom verb from the resource name is to support arbitrary paths. For example, undelete a file can map to POST /files/a/long/file/name:undelete

    Source: https://cloud.google.com/apis/design/custom_methods

    So for validation the URL should be POST /resource:validate

提交回复
热议问题