|
JSON array not allowed in HTTP post content |
Iniciado por Jim, 11,abr. 2025 19:25 - 1 respuesta |
| |
| | | |
|
| |
Publicado el 11,abril 2025 - 19:25 |
We keep getting this syntax error although it is valid. We are wondering if it is a WINDEV bug. WINDEV won't allow an array here. We want to use this in a website that requires an array. beebotte.com
MyRequest..ContentType = "application/json" MyRequest..Content = [ { "library": { "name": "City Central Library", "books": [ { "id": "book1", "title": "To Kill a Mockingbird", "author": "Harper Lee", "year": 1960 }, { "id": "book2", "title": "1984", "author": "George Orwell", "year": 1949 } ] } } ]
Thanks Jim |
| |
| |
| | | |
|
| | |
| |
Publicado el 21,abril 2025 - 13:29 |
Jim a écrit :
We keep getting this syntax error although it is valid. We are wondering if it is a WINDEV bug. WINDEV won't allow an array here. We want to use this in a website that requires an array. beebotte.com
MyRequest..ContentType = "application/json" MyRequest..Content = [ { "library": { "name": "City Central Library", "books": [ { "id": "book1", "title": "To Kill a Mockingbird", "author": "Harper Lee", "year": 1960 }, { "id": "book2", "title": "1984", "author": "George Orwell", "year": 1949 } ] } } ]
Thanks Jim
Make use of backticks to declare the variable see (https://doc.windev.com/en-US/…)
Multiline string literal with backticks ( ` )
MyRequest.Content = ` { "library": { "name": "City Central Library", "books": [ { "id": "book1", "title": "To Kill a Mockingbird", "author": "Harper Lee", "year": 1960 }, { "id": "book2", "title": "1984", "author": "George Orwell", "year": 1949 } ] } } ` |
| |
| |
| | | |
|
| | | | |
| | |
|