(Migrated) SIO types in GET request

(This message has been automatically imported from the retired mailing list)

(re)Hello,

it seems to me that Zato doesn’t convert SIO values to Integer on GET
requests.

I have this service:

classSleep(Service):

 classSimpleIO:
     input_required = (Integer('sleep_s'), )

 defhandle(self):
     sleep_s = self.request.input['sleep_s']
     self.logger.info("type: {}".format(type(sleep_s)))
     sleep(sleep_s)

Notice the last line, sleep() takes a number.

I invoke it with a POST:

curl localhost:11223/test/sleep -d ‘{“sleep_s”: “2”}’

it works and it says: "type: "

when I invoke it with a GET:

curl localhost:11223/test/sleep?sleep_s=2

it doesn’t work (TypeError) and it says “type: <type ‘unicode’>”

Cheers!

On 29/04/15 15:38, Andrea Peter wrote:

it seems to me that Zato doesn’t convert SIO values to Integer on GET
requests.

Hi Andrea,

you are right, this is an omission and will be fixed in 2.0.4.

thanks a lot,