Android Question Need help with JSON

juventino883

Member
Licensed User
Longtime User
Hi, I try to send a JSON string but i dont know how to set the headers or how is the right way to send it, this is what i want to send:

B4X:
JSON Examples
Header: Authorization: Basic YWRtaW46MTIzNDU=
Header: Content-Type: application/json

POST http://example.org:9090/plugins/restapi/v1/users

Payload Example 1 (required parameters):

{
"username": "admin",
"password": "p4ssword"
}

Payload Example 2 (available parameters):

{
"username": "admin",
"password": "p4ssword",
"name": "Administrator",
"email": "[email protected]",
"properties": {
"property": [
{
"@key": "console.rows_per_page",
"@value": "user-summary=8"
},
{
"@key": "console.order",
"@value": "session-summary=1"
}
]
}
}


If someone could help me with some code or example I would appreciate it, thanks in advance!.
 
Top