on 01-13-2014 2:07 PM
Hi,
If i give the following URL with a PUT request.
<hostname>:<port><serviceroot>DocItemSet(DocItemID='1003',DocItemID='001')?Quantity='20.00'
At backend, inside the data provider class UPDATE_ENTITY method, how can i retrieve the value entered by the user for 'Quantity' as entered as parameter in the URL.
Thanks & Regards,
Naseem
Hi Naseem,
What do you want to achieve with this query?
If Quantity is a property of a DocItem that you want to update, you can do that with a PATCH request that provides the values of the properties to change as a JSON object:
PATCH <hostname>:<port><serviceroot>DocItemSet(DocID='1003',DocItemID='001') HTTP/1.1
Content-Type: application/json
{"Quantity":20.00}
Hope this helps!
--Ralf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ralf,
Thanks for the reply.
To make it simple,
my requirement was to update the quantity field of the DocItemSet(DocID='1003',DocItemID='001').
so i was thinking whether i can send a PUT request without any payload since it was only one property update.
Is it possible to send a PUT request without payload?
Also please tell me how to access the value passed as in this request for 'Quantity' in the data provider class.
(DocItemID='1003',DocItemID='001')?Quantity='20.00'.
Is it possible to access which as passed as params?
Thanks & Regards,
Naseem
Hi Naseem,
you can't use PUT without a payload, and you can't access non-standard query options.
Using non-standard query options has the disadvantage of making your service unusable for standard OData clients, and for developers that haven't been educated by you in how to use these non-standard query options.
Regards!
--Ralf
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.