Hi,
In Service Rest rule we have methods POST and PUT.
We can use Activity in POST method to create/insert record in database table.
The same activity we can use in PUT also, so basically what is the difference between these 2 methods?
Hi,
In Service Rest rule we have methods POST and PUT.
We can use Activity in POST method to create/insert record in database table.
The same activity we can use in PUT also, so basically what is the difference between these 2 methods?
Hi @AbhishekC1725, In POST method, you can create a data object, for example: you can create a new employee id and create details of the new joiner. In PUT method , you can update the data object. for example: updating the details of the new joiner .
So basically POST is for creating and PUT is for updating.
For more details, check this article: Pegasystems Documentation
@AbhishekC1725
In general, the HTTP PUT method is used to update an existing resource, while the POST method is used to create a new resource
@GiridharanVenkat Thanks for this,
The description you gave I also followed the same, but in one discussion that Lead is asking this scenario, but in PUT method section inside activity we can write the logic for creating the new data object ?
So how to justify this thing?
@sangr2 Thanks for this,
The description you gave I also followed the same, but in one discussion that Lead is asking this scenario, but in PUT method section inside activity we can write the logic for creating the new data object ?
So how to justify this thing?
Hi @AbhishekC1725, In terms of PEGA, PUT and POST more are less the same but interms of HTTP. the difference is as of follows.
Hi @AbhishekC1725,
Yes, We can use the same activity for POST and PUT methods in service-Rest. we can use when conditions in activity steps i.e. Param.pyActionType= “POST” for entering a new record, Param.pyActionType= “PUT” for updating the existing record and write logics based on methods.
Regards,
Mohd Qizer Uddin.
@Mohd Qizer Uddin Thanks for response. And approach
I believe the interpretation is wrong PUT and POST methods - actions/protocols have to be defined by the team that is hosting the service. We have to pass in the required and optional attributes as part of the request as defined by the service.
Activity rule - Yes, we can create a new data object from the activity rule in general.
Thanks,
@GiridharanVenkat Thanks for response.
@sangr2 Thanks for response. And description![]()
@AbhishekC1725 please could you mark with ‘Accept Solution’ the reply which resolved your question?