Published on InterSystems Developer Community (https://community.intersystems.com)

Home > REST Service how to accept a Json request

Question
Thembelani Mlalazi · Sep 16, 2022

REST Service how to accept a Json request

I have a REST Service that I want it to receive a json string request I have set up my URLMap as follows the top URL when populated and requested works fine but I would like my request to be a json string and that is not working I am getting a 500 error am I missing something please advice.

 

XData UrlMap
{
<Routes>
<Route Url="/:emailAddress/:sendUserEmail/:password" Method="POST" Call="ResetPassword"/>        this works fine
<Route Url="/test" Method="POST" Call="test"/>              I would like this to receive a json formatted string for the above
</Routes>
}

#Business Service #JSON #REST API #Caché
Product version: Caché 2018.1
$ZV: Cache for Windows (x86-64) 2018.1.4 (Build 505_1U) Thu May 28 2020 10:01:40 EDT [HealthShare Modules:Core:15.032.9035 + Linkage Engine:15.032.9035]

Source URL:https://community.intersystems.com/post/rest-service-how-accept-json-request