function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rplrpl 

JSON Parser: Need help in understanding it

{"example":{"Os":"windows","Origin":"xyz"}} is my request string that is sent to a HTTPPost REST Web service in salesforce. 

@RestResource(urlMapping='/NewIncident/*')
global without sharing class WSIncident {
    @HttpPost
    global static String createMobileCase(string example) {
        contact newCase = new contact();
        JSONParser jParser = JSON.createParser(example);


/*CAN SOME ONE PLEASE HELP ME PARSE THIS JSON*/

     return newCase.Id;
}
}
rplrpl
while (jparser.nextToken() != NULL) {
        if (jparser.getCurrentToken() == JSONToken.FIELD_NAME){
            if (jparser.getText() == 'Os'){
                jparser.nextToken();
                os = jparser.getText();
            }
            else{
                jparser.nextToken();
                origin = jparser.getText();
            }
        }

Above code gives me an error: Unexpected parameter encountered during deserialization: Os
Please!! Any help will be highly appreciated!!!