http-patch

JMeter: How to send parameters with PATCH method?

不打扰是莪最后的温柔 提交于 2019-12-11 09:58:28
问题 My JMeter version is the latest version 2.13. I would like to add an HTTP request to test my API, and the method is either PATCH or PUT. In Postman, I can test the API and succeed using the PATCH method with some URL parameters. For example: URL: https://example.com/user/account URL parameters: email ----> example@example.com URL parameters: password ----> 12345678 Method: PATCH This works in Postman/Paw but in JMeter I setup an HTTP request, add the parameters, and it fails. How I can setup

Web API 2 does not process PATCH requests for Integers

五迷三道 提交于 2019-12-10 15:53:36
问题 I'm having a problem with Web API 2 (.net 4.5.1) in that it seems to ignore PATCH requests where the property is an integer, but processes other types without a problem (I've tested string and decimal). I’ve setup an unsecured test API with a 'products' controller at http://playapi.azurewebsites.net/api/products. If you do a GET to that URL, you’ll get something like this product back: {"Id": 1,"Name": "Xbox One","Category": "gaming","Price": 300,"Stock": 5} ‘Name’ and ‘Category’ are both

Is a partial representation of document a valid “set of changes” as per HTTP PATCH RFC?

南楼画角 提交于 2019-12-06 04:54:35
问题 Here is what RFC 5789 says: The PATCH method requests that a set of changes described in the request entity be applied to the resource identified by the Request-URI. The set of changes is represented in a format called a "patch document" identified by a media type. If the Request-URI does not point to an existing resource, the server MAY create a new resource, depending on the patch document type (whether it can logically modify a null resource) and permissions, etc. The difference between

PATCH method handler on Google AppEngine WebApp2

孤人 提交于 2019-12-05 17:44:24
问题 I tried to use a def patch(): method in my webapp2.RequestHandler to support partial resource updates, but then saw that the allowed methods are frozen in webapp2.py: allowed_methods = frozenset(('GET', 'POST', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE')) How can I extend webapp2.RequestHandler or modify the WSGIApplication class to allow the PATCH HTTP method when deployed on Google AppEngine? 回答1: Just use a monkey patch by performing this before creating a WSGIApplication : allowed

Is a partial representation of document a valid “set of changes” as per HTTP PATCH RFC?

寵の児 提交于 2019-12-04 10:41:11
Here is what RFC 5789 says: The PATCH method requests that a set of changes described in the request entity be applied to the resource identified by the Request-URI. The set of changes is represented in a format called a "patch document" identified by a media type. If the Request-URI does not point to an existing resource, the server MAY create a new resource, depending on the patch document type (whether it can logically modify a null resource) and permissions, etc. The difference between the PUT and PATCH requests is reflected in the way the server processes the enclosed entity to modify the

PATCH request method in Backbone.js

☆樱花仙子☆ 提交于 2019-12-04 10:24:27
问题 What is the right way to perform PATCH request while saving model's attributes in Backbone.js? 回答1: As of Backbone.js v0.9.9, you can simply pass { patch: true } to save() . Read more: http://backbonejs.org/#changelog 回答2: In addition to James Cropchos answer I want add the following, because this stole some hours from me and maybe helps someone else: If you use model.save(attributesToPatchObject,{patch: true}) like it is possible since backbone v.0.9.9 as stated in James Cropchos answer, you

PATCH method handler on Google AppEngine WebApp2

空扰寡人 提交于 2019-12-04 02:04:57
I tried to use a def patch(): method in my webapp2.RequestHandler to support partial resource updates, but then saw that the allowed methods are frozen in webapp2.py: allowed_methods = frozenset(('GET', 'POST', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE')) How can I extend webapp2.RequestHandler or modify the WSGIApplication class to allow the PATCH HTTP method when deployed on Google AppEngine? Just use a monkey patch by performing this before creating a WSGIApplication : allowed_methods = webapp2.WSGIApplication.allowed_methods new_allowed_methods = allowed_methods.union(('PATCH',)) webapp2

PATCH request method in Backbone.js

蓝咒 提交于 2019-12-03 05:52:35
What is the right way to perform PATCH request while saving model's attributes in Backbone.js? James Cropcho As of Backbone.js v0.9.9, you can simply pass { patch: true } to save() . Read more: http://backbonejs.org/#changelog In addition to James Cropchos answer I want add the following, because this stole some hours from me and maybe helps someone else: If you use model.save(attributesToPatchObject,{patch: true}) like it is possible since backbone v.0.9.9 as stated in James Cropchos answer, you may wonder how to determine which attributes have changed since the last call of model.save() to

How to PATCH a single field using Django Rest Framework?

。_饼干妹妹 提交于 2019-11-30 10:26:28
问题 I have a model 'MyModel' with many fields and I would like to update a field 'status' using PATCH method. I'm using class based views. Is there any way to implement PATCH? 回答1: Serializers allow partial updates by specifying partial=True when initializing the serialzer. This is how PATCH requests are handled by default in the generic views. serializer = CommentSerializer(comment, data=request.data, partial=True) This will allow you to update individual fields in a serializer, or all of the

Should I use PATCH or PUT in my REST API?

一曲冷凌霜 提交于 2019-11-27 09:57:46
I want to design my rest endpoint with the appropriate method for the following scenario. There is a group. Each group has a status. The group can be activated or inactivated by the admin. Should I design my end point as PUT /groups/api/v1/groups/{group id}/status/activate OR PATCH /groups/api/v1/groups/{group id} with request body like {action:activate|deactivate} Luke Peterson The PATCH method is the correct choice here as you're updating an existing resource - the group ID. PUT should only be used if you're replacing a resource in its entirety. Further information on partial resource