Java Request on warp10

25 views
Skip to first unread message

ARNAUD COSTE

unread,
Jun 19, 2020, 5:31:58 AM6/19/20
to Warp 10 users
Hi,

I make http requests to warp10 in a java application. these requests systematically send me a code '200' OK but accompanied by an empty table. 
The same requests in grafana correctly recover the data.
I do a POST (request in warpscript) on api / V0 / exec as described in the documentation.
I defined Content-Type: text / plain; charset = UTF-8 also but nothing helps.
what could explain this difference in response?

Mathias Herberts

unread,
Jun 21, 2020, 4:19:44 AM6/21/20
to Warp 10 users
Hi,

you can have a look at the REXEC (io.warp10.script.ext.rexec.REXEC) implementation which does exactly what you are intending to do.

Pierre

unread,
Jun 22, 2020, 5:27:19 AM6/22/20
to Warp 10 users
Hi, 

The grafana requests are printed in the console. It may help you to understand the difference, if any. 

Start with something really simple, like "NOW" , or "REV", in your WarpScript, to test your java code.


ARNAUD COSTE

unread,
Jun 22, 2020, 5:44:02 AM6/22/20
to Warp 10 users
Thanks for response

I executed my request in WarpStudio and it worked correctly.
I set  Content-Type: text / plain; charset = UTF-8 as described in doc.

the warp10 server always sends me back a 200 with an empty array. the strangest thing is that sometimes (1 time out of 6) in debug mode my call sends me the data correctly.
is there a special parameter for http requests to a warp10 server ?

Mathias, you told me to use REXEC, what is the difference with / api / v0 / exec that I use?

Mathias Herberts

unread,
Jun 22, 2020, 8:12:47 AM6/22/20
to Warp 10 users
The approach is not different, it was just to point you to a code example which is known to work.
Reply all
Reply to author
Forward
0 new messages