Skip to content

Instantly share code, notes, and snippets.

@msrivastav13
Created August 19, 2013 18:30
Show Gist options
  • Save msrivastav13/6272456 to your computer and use it in GitHub Desktop.
Save msrivastav13/6272456 to your computer and use it in GitHub Desktop.
@HttpPost
global static string postwebserviceutil() {
//Extracting the data from the JSON HTTP request object sent from Timetrade
RestRequest req = RestContext.request;
RestResponse res=RestContext.response;
Blob body=req.requestBody;
String jsonToParse=body.toString();
jsonToParse=jsonToParse.replace('class','classx'); //replacing if any keyword found
jsonToParse=jsonToParse.replace('limit','limitx');
jsonToParse=jsonToParse.replace('_externalIDs','externalIDs');
//Deserializing the data sent into concrete SFDC objects
DeserialisedClass var =(DeserialisedClass)JSON.deserialize(jsonToParse,DeserialisedClass.class);
system.debug('value'+var );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment