Re: [Cppcms-users] CppCMS 1.x.x JSON object value empty/not exist
Brought to you by:
artyom-beilis
From: Artyom <art...@ya...> - 2010-06-15 14:44:15
|
BTW I forgot to mention, cppcms provides built-in JSON-RPC facilities: See: http://art-blog.no-ip.info/cppcms_ref_v0_99_1/classcppcms_1_1rpc_1_1json__rpc__server.html And a simple example in "tests/jsonrpc_test.cpp" Artyom ________________________________ From: Geert Van de Velde <gee...@ba...> To: cpp...@li... Sent: Tue, June 15, 2010 4:54:38 PM Subject: [Cppcms-users] CppCMS 1.x.x JSON object value empty/not exist Hi, I'm trying to use cppcms for a new project and use it for building a RESTLike API for a device. The API will communicate with the JSON data format. When receiving JSON data from a client some fields of an object are optional. I'm using json::value for handling this. I use the get<T> function to fetch the fields but in case of a missing field or invalid field data it throws an exception. Is it possible to detect that the field is missing separately? So I can ignore missing optional fields. Tnx DISCLAIMER: Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you. ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |