HTTP Request Example


Using URI query parameters

Taking the distance resource as an example, all the parameters in the GET request for distance resource, according to REST API, are URI query parameters. The parameter description is as follows:

Name Type Description
point2Ds Point2D[] The point set used for calculation.
unit Unit The unit for the result.

The complete HTTP request for implementing the GET request on the distance resource is:

GET /iserver/services/components-rest/rest/maps/World/distance.rjson?point2Ds=[{"y":26,"x":101},{"y":21,"x":97},{"y":16,"x":103}]&unit=METER HTTP/1.1

Host: supermapiserver:8090

Using request body parameters

Taking the distance resource as an example, all the parameters in the PUT request for distance resource, according to REST API, are request body parameters. The parameter description is as follows:

Name Type Description
description String The descriptive information for the datasource.
coordUnit Unit The unit for the coordinates.
distanceUnit Unit The distance unit.

The complete HTTP request for implementing the PUT request on the distance resource is:

PUT /iserver/services/components-rest/rest/data/datasources/name/world.rjson HTTP/1.1

Host: supermapiserver:8090

Content-Length: 84

 

{"coordUnit":"MILE","description":"This is a new description","distanceUnit":"MILE"}

The complete HTTP request for implementing the PUT request on the distance resource is:

PUT /iserver/services/components-rest/rest/data/datasources/name/world.rjson HTTP/1.1

Host: supermapiserver:8090

Content-Length: 84

X-RequestEntity-ContentType: application/xml

 

<Object>

        <description>This is a new description</description>

        <coordUnit>MILE</coordUnit>

        <distanceUnit>MILE</distanceUnit>

</Object>

See