+1 (855) 920-2583
Login

Methods declared with verb 'POST' or 'PUT' get boolean 'true' instead of passed parameters

Modified on: Fri, 17 Nov 2023 12:07 PM
Original Publishing Date:
2020-01-22

Symptoms

Your APS2 package uses PHP runtime, and you declare a custom method that receives parameters via POST or PUT, like this:

/**
* @verb(POST)
* @path("/parambypost")
* @param(string,query)
*/
public function parambypost($postparam){
  return $postparam;
}

However, instead of expected parameter, the function returns 'true':

user$ curl -X POST -d 'postparam=123' http://endpoint.sandbox.apsdemo.org/myapp/myservice/2b8592be-239f-470b-b8e6-64f69abb896f/parambypost
true

Cause

PHP runtime bug

Resolution

Upgrade your PHP runtime to a more recent version. You can obtain an up-to-date version at the PHP Runtime Library page on APS standard website.

Internal content