Daniel Suzuki

unread,
Nov 9, 2017, 1:03:14 PM11/9/17
to MIT App Inventor Forum
Dear Sirs:

I have an issue trying to use the POST Text API to get a response from an IBM Watson service.

The issue seems to be in the format of the data sent as a text to the service.The IBM service needs it to be in json format but the POST file API in AI2 sends it as plain text. althought the way data is constructed follow a json format,



Can you please give a suggestion on how to properly send a data segment for a POST API call in json format?


I have used POSTMAN tool to test the argument used in my AI2 code and they worked fine just becasue data is declared as application/json format.


I found out another question about the same topic where this very same problem in AI2 was not solved at that time. 


I look forwar for your help and comment.

Sincerely

Daniel Suzuki

Farzeen Harunani

unread,
Nov 9, 2017, 1:22:14 PM11/9/17
to MIT App Inventor Forum
Hi,
The one mistake that popped out quickly is that "true" doesn't have quotation marks around it in your json. Also, are you sure the brackets and fields are as expected?
Keep us "post"-ed!
Farzeen

Daniel Suzuki

unread,
Nov 9, 2017, 1:33:22 PM11/9/17
to MIT App Inventor Forum
Hi, and thanks for your pbservation but it is without quotes that true must be posted, so please don´t close my question as it is not selved yet.

My intention is not to ask for help on things I have been working by my self for more than three days without success. I can tell that you that whe I ask for help here is because I have tried all posible variants I come accross.

Encosed POSTMAN scree that shows true without quotes and proper response from IBM Watson service.

Regards.

Daniel Suzuki




Farzeen Harunani

unread,
Nov 9, 2017, 1:46:56 PM11/9/17
to MIT App Inventor Forum
Sorry that wasn't helpful--I've seen an application or two where true/false had quotes and that worked. 
Have you tried using Post with Encoding? 

Taifun

unread,
Nov 9, 2017, 2:11:15 PM11/9/17
to MIT App Inventor Forum
remove the colons in the header...
Taifun


Daniel Suzuki

unread,
Nov 9, 2017, 2:33:04 PM11/9/17
to MIT App Inventor Forum
I did as Taifun sugested and worked!!

As always, you find what the workshop blindness do not allow me  to see Taifun

Thank.you.
Reply all
Reply to author
Forward
0 new messages