I have tried one undefined rest path through ColdFusion Rest Playground and it gives response like below;
{
"MESSAGE": "Not Found",
"STATUS": 404
}
When I am trying the same from POSTMAN, its gives 404 server error!
server error 404 - File or directory was not found. The resource you are looking for may have been removed, renamed, or temporarily unavailable.
Tried using Accept header as application/json, but its not working.
Here is the configuration of REST Service;
Root Path Service Mapping Default Host:Port
D:\Projects\restSample\ v1 NO my.restAPI
REST Path
rest
And the URL I have tried;
http://my.restAPI/rest/v1/api/test => Working
http://my.restAPI/rest/v1/api/test1 => Gives 404 (but not JSON)
api.cfc
<cfcomponent rest="true" restpath="api">
<cffunction name="getTest" restpath="test" access="remote" returntype="struct" httpmethod="GET" produces="application/json">
<cfset var response = {} />
<cfset response["message"] = "Test" />
<cfreturn response>
</cffunction>
</cfcomponent>
How can I get the response as JSON format in POSTMAN for http://my.restAPI/rest/v1/api/test1?