You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 4, 2022. It is now read-only.
Hi,
i have a problem sending data via a post request to my server.
It works fine with simple data (strings, numbers) but it goes wrong when i send arrays or objects as the data.
I have this data structure that i am trying to send:
(console.log on the client)
Userdata
Object {Name: "mm", LoginName: "mm", Password: "mm", Roles: Array[2], Language: "de"…}
Groups
:
Array[2]
0
:
"56f064923e30b1c32aabd8ef"
1
:
"56f064923e30b1c32aabd8f0"
length
:
2 proto
:
Array[0]
Language
:
"de"
LoginName
:
"mm"
Name
:
"mm"
Password
:
"mm"
Roles
:
Array[2]
0
:
"56f064923e30b1c32aabd8ec"
1
:
"56f064923e30b1c32aabd8ed"
length
:
2 proto
:
Array[0] proto
:
Object
i send this as an object like this
data = {}
data.userData = (above object)
simplified
ajax
type: POST
content-type: application/json
data: data
Hi,
i have a problem sending data via a post request to my server.
It works fine with simple data (strings, numbers) but it goes wrong when i send arrays or objects as the data.
I have this data structure that i am trying to send:
(console.log on the client)
Userdata
Object {Name: "mm", LoginName: "mm", Password: "mm", Roles: Array[2], Language: "de"…}
Groups
:
Array[2]
0
:
"56f064923e30b1c32aabd8ef"
1
:
"56f064923e30b1c32aabd8f0"
length
:
2
proto
:
Array[0]
Language
:
"de"
LoginName
:
"mm"
Name
:
"mm"
Password
:
"mm"
Roles
:
Array[2]
0
:
"56f064923e30b1c32aabd8ec"
1
:
"56f064923e30b1c32aabd8ed"
length
:
2
proto
:
Array[0]
proto
:
Object
i send this as an object like this
data = {}
data.userData = (above object)
simplified
ajax
type: POST
content-type: application/json
data: data
on the server console.dir(reqdata: req.data) shows:
(object)
reqdata
itkfc e203eaaa-3200-8fe3-8f55-57643d68b2a5
userData%5BName%5D mm
userData%5BLoginName%5D mm
userData%5BPassword%5D mm
userData%5BRoles%5D%5B%5D 56f064923e30b1c32aabd8ed
userData%5BLanguage%5D de
userData%5BGroups%5D%5B%5D 56f064923e30b1c32aabd8f0
if i dont send it as a subobject of the data, i get a problem with the arrays (Roles, Groups) where it displays them similar to the above.
Any idea ?