← Back to team overview

dhis2-devs team mailing list archive

Re: Single Event Without Registration Update

 

Thank you, Morten.

'PUT' instead of 'POST' make it work.



On Wed, Aug 28, 2013 at 4:12 PM, Morten Olav Hansen <mortenoh@xxxxxxxxx>wrote:

> Sorry, the request method should of course be set to PUT (for update), and
> not POST. Try changing it to PUT and it should work.
>
> --
> Morten
>
>
> On Wed, Aug 28, 2013 at 8:54 AM, James Chang <jamesbchang@xxxxxxxxx>wrote:
>
>> Yes, the Content-Type header was set to "application/json".
>>
>> I was able to add the event data(Using the same setting except
>> 'events/--'), but update one is failing.
>>
>>
>> On Wed, Aug 28, 2013 at 3:45 PM, Morten Olav Hansen <mortenoh@xxxxxxxxx>wrote:
>>
>>> Did you try and set the Content-Type header to "application/json" ?
>>>
>>> --
>>> Morten
>>>
>>>
>>> On Wed, Aug 28, 2013 at 7:17 AM, James Chang <jamesbchang@xxxxxxxxx>wrote:
>>>
>>>> Hi,
>>>>
>>>> For updating data for Single Event Without Registration (doc section
>>>> 25.7),
>>>> I am getting errors.  By any chance, has this been fixed in newer
>>>> version?
>>>>
>>>> I am using
>>>> Version: 2.13-SNAPSHOT
>>>> Build revision: 10926
>>>>
>>>> When I tried updating the values with below info:  (refer
>>>> Update_Post_Request.jgp)url -->
>>>> http://localhost:8081/api/events/XuzCJ0dzq6  content:{ "program":
>>>> "m24Z0694qQH", "orgUnit": "qkn1mKNR8XP", "eventDate": "2013-08-01",
>>>> "completed": false, "storedBy": "admin", "dataValues": [{ "dataElement":
>>>> "N5jJ5SxRuR4", "value": "46" }] }
>>>>
>>>> I get an error output with: (refer Error.jpg)Request method 'POST' not
>>>> supported The specified HTTP method is not allowed for the requested
>>>> resource.
>>>>
>>>>  When I try the initial add with same content, it works fine.  But
>>>> updating the event data seems to not work.
>>>>
>>>>
>>>
>>
>

References