考虑这是样本请求..
现在我必须发布此... ..一旦添加了详细信息,我想检查只在数据库中添加的正确详细信息。我从DB中提取了值。
我知道如何从响应中提取值...任何人都可以帮助我从JSON请求中获取值...就像我需要提取firstname,lastname等,可以任何人帮助我在这?
请求:
POST /MMNRS/1/consumer HTTP/1.1
Host: http://subdomain.example.com
Device-ID: 2b6f0cc904d137be2e1730235f5664094b831186
Client-Type: IPHONE
Client-Version: 1.0
User-Agent: Tap/1.0 (iPhone; U; iOS 4.1; en_gb)
Accept: application/json
X-Request-ID: 10002
{
“consumerDetails”:
{
“title”:”Mr”,
“firstName”:”John”,
“lastName”: “Doe”,
“dateOfBirth”:”12/05/1956”,
“email”:”johndoe@gmail.com”,
“encryptedPassword”:”XXXXYYYYZZZZ”,
“acceptedTermsAndConditionsFlag”:true,
“acceptedPromotionsAndOffersFlag” : true
“versionNumber”: 0
}
“twk”: “XXYYZZVVSS”
“passwordLength”: 7
“encryptedConfirmPassword”:”XXXXYYYYZZZZ”,
“confirmPasswordLength”: 7
“confirmEmail”:”johndoe@gmail.com”,
“securityQuestionAnswers” :
[
{
“securityQuestionId” : 1001,
“securityAnswer” : “Rufus the Dog”
“versionNumber”: 0
},
{
“securityQuestionId” : 1002,
“securityAnswer” : “Beethovan”
“versionNumber”: 0
}
],
}