rtype = void

Asked by Ales Klimsa on 2011-12-17

Could you advice me how could I define WS method, which doesn't returns any parameter (void) ?
Thank you

Question information

Language:
English Edit question
Status:
Solved
For:
ladon Edit question
Assignee:
No assignee Edit question
Solved by:
Ales Klimsa
Solved:
2011-12-18
Last query:
2011-12-18
Last reply:
2011-12-18
jsgaarde (jakob-simon-gaarde) said : #1

In which way should it return void?
(1) Do you want it to mime json-rpc's notification (udp-like transmission where you send a request but never recieve a reponse)
(2) Or do you want a normal response just without return values?

if 2:
  In the current Ladon implementation methods must return a result, so the easiest solution is to return a dummy int,
  bool or empty string. You can also create a new class inheriting CustomResponse (ladon.server.customresponse). You can use
  such classes as rtype to methods and control the http response 100%.

See example here:
http://pypi.python.org/pypi/ladon/0.6.5#new-in-0-6-4

Best Regards
Jakob simon-Gaarde

Ales Klimsa (ales-klimsa) said : #2

I need response without return values. Probably I will return int or boolean value. Thanks for answer