How to pass Vertex id as a parameter via POST

Having a bit of trouble figuring out how to pass a Vertex parameter via HTTP POST.

Here’s the function signature:

CREATE QUERY delete_strategy_instance(VERTEX<IbisInstance> instance) syntax v2 {

I’m doing a POST with {"instance": "test_delete_a1"}
And I’ve also tried {"instance": {"type":"IbisInstance","instance_name":"test_delete_a1"}}
And I’ve also tried {"instance": {"type":"IbisInstance","id":"test_delete_a1"}}

Using GET works, but I want to make sure I know how to get this working with POST for future.
Any advice?

If the REST++ server is local, then server_ip is localhost.

The request can use either the GET or POST method. The query parameter values are either included directly in the query string of the HTTP request’s URL or supplied using a data payload. The basic format for the parameters as a query string is

If you use data payload, JSON format only support GET. We are developing JSON format to support POST in the next minor release version.

What about the example right here:

Looks like it’s using POST data payload to specify vertices:

curl -s -X POST 'http://localhost:9000/shortestpath' -d
  "targets":[{"type":"VidUser","id":"0"}, {"type":"VidUser","id":"3"}],
  "edgeFilters":[{"type":"User_Video","condition":"rating > 5 and date_time > 1000}],

Also looks like there’s a missing quote in that example.

the doc of shortestpath is a built-in query. It’s not written by GSQL. If you use GSQL install query to generate the endpoint, we do not support passing parameter by json using POST yet. It’s coming though.

1 Like