gpt4 book ai didi

javascript - 这两个请求之间的区别

转载 作者:行者123 更新时间:2023-11-30 07:18:08 25 4
gpt4 key购买 nike

请求一个(不工作)

{
"AddNewRequest":{
"Patient":{
"PrimaryPhoneNumber":" ",
"DateOfBirth":" ",
"CellPhoneNumber1":" ",
"ResidentialAddress":{
"AddressLine1":" ",
"State":" ",
"City":" ",
"PostalCode":" "
},
"PhoneNumber1":" ",
"SSN":" ",
"FullName":"John",
"Religion":" ",
"Gender":" ",
"Race":" ",
"Firstname":"Vinoth",
"EmailAddress1":" ",
"LastName":"Cooper"
},
"Header":{
"SourceSiteID":"300242",
"DestinationSiteID":"300242",
"PrimeSuiteUserID":"1"
},
"Credentials":{
"VendorCredential":{
"VendorLogin":"testGUID",
"VendorPassword":"testGUID"
},
"PrimeSuiteCredential":{
"PrimeSuiteUserPassword":"password",
"PrimeSuiteSiteId":"1",
"PrimeSuiteUserName":"Admin"
}
}
}
}

请求二(工作)

{
"PatientAddNewRequest":{
"Credentials":{
"PrimeSuiteCredential":{
"PrimeSuiteSiteId":"300242",
"PrimeSuiteUserName":"Admin",
"PrimeSuiteUserPassword":"password"
},
"VendorCredential":{
"VendorLogin":"testGUID",
"VendorPassword":"testGUID"
}
},
"Header":{
"DestinationSiteID":"300242",
"PrimeSuiteUserID":"1",
":SourceSiteID":"300242"
},
"Patient":{
"CellPhoneNumber1":"206-567-2222",
"DateOfBirth":"/Date(1306348200000)/",
"EmailAddress1":"JohnDoe@yahoo.com",
"Firstname":"TestMan1",
"FullName":"TestFullMan1",
"Gender":"2",
"LastName":"Testlastname1",
"PhoneNumber1":"205-567-1111",
"PrimaryPhoneNumber":"205-456-4545",
"Race":"2",
"Religion":"3",
"ResidentialAddress":{
"City":"Carrollton",
"PostalCode":"35209",
"State":"10"
},
"SSN":"911-91-9191"
}
}
}

我只是无法弄清楚为什么第一个请求不起作用而第二个请求给出了响应。任何人都可以确定我做错了什么。

顺序重要吗?

更新

第一个向我抛出错误请求,第二个按预期响应。

最佳答案

在 JSON 中,顺序无关紧要,但名称很重要。在请求一中,您有“AddNewRequest”,而在请求二中,您有“PatientAddNewRequest”

同样在服务器端,序列化器/反序列化器可能需要特定的顺序。

JSON

An object is an unordered collection of zero or more name/value pairs, where a name is a string and a value is a string, number, boolean, null, object, or array.

关于javascript - 这两个请求之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6208660/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com