Connect to API using Web and error 1110

image
Yes, I used join to enclose the 'question' in the quotation marks

ProcessMessage is a print function that prints to the screen

(stumped).

average dev life

i am new to App-inventor, is there really no other way to send a json?

took a bit long but using the print
you guys probably already know
it just stuck at the post JSON text

thanks you guys anyways

it may be a part on the API side some where, all I got is the link and its syntax

Remove the 4 backslashes

And remove those default headers again

Also you can use Do it to get your JSON string and check, if it is valid for example here

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

It still does not work, all the commas are in place, used a print procedure


to check

Remove the \n
Did you check the JSON as suggested at jsonlint?
Post the Do it result

Taifun

remove the \n .
And a good practise is to use a Make Dictionary block, that will give you a valid json string.

Also what happened with the request header? You should set at least the content-type

Taifun

And in your history tag you removed too much... you always have a tag/value pair... therefore you should write inside the curly brackets:

{"prompt":""}

Testing with jsonlint would have revealed the error

Taifun

I added back the headers with Connection:Keep-alive

heres the error


The \n was added in after not having it to see of it would work

You forgot the [ and ] brackets. .
Why don't you use jsonlint?

Taifun

I tried again with use "make a dictionary"
{
"active_docs": "9YziSqpbHVha3Lkao23uvSXR2On1\/document\/ UEL-IS",
"conversation_id": "65783f4c0218916ddd553ca9",
"history": "[{"prompt":""}]",
" question": "bye",
"user": "9YziSq pbHVha3Lkao23uvSXR2On1 ",
"user_type": "premium"
}
JSON is valid from JSONLint

You forgot the [ and ] brackets. .
Why don't you use jsonlint?

Taifun

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Get Do it running, then use jsonlint to directly see your error in the JSON...
This helps you stop wasting your and our precious time

Taifun

The JSON from your latest screenshot of your blocks is invalid, because the [ and ] brackets are missing
What about posting your Do it result and jsonlint result here ?
Taifun