Runtime components : Channels components : REST channel : Tasks : Handling Session
  
Handling Session
As the picture shows, there are some parameters required for the process. Here lists all the parameters and the example values:
{Project Name}: TestRestChannel
{KColl Name}: OneKColl
{Data Name}: dataString
{IColl Name}: OneIColl
{Index}:0
 
Resource
Method
Parameters
Consume
Produce
rest/session/establish
POST
 
 
application/json
rest/session/{params:.*}
GET
callback sid
 
application/json
application/javascript
 
POST
 
application/json
application/json
 
PUT
 
application/json
application/json
 
DELETE
 
 
application/json
1 Get sessionId. Access the following URL.
http://localhost:8080/TestRestChannel/rest/session/establish
It would return the json string with dse_sessionId.
Note No matter handling session, operation or flow, we need to get sessionIdfirst.
2 Get the value of data in session. Access the URL.
Field:
http://localhost:8080/TestRestChannel/rest/session/ dataString
KColl:
http://localhost:8080/TestRestChannel/rest/session/OneKColl/ dataString
IColl:
http://localhost:8080/TestRestChannel/rest/session/OneIColl/0
It would return the data with index 0 in IColl.
3 Edit data value of session. Access the URL. The input value should be json string, for example:
{{”dataString”:”hello”}
Field:
http://localhost:8080/TestRestChannel/rest/session
KColl:
http://localhost:8080/TestRestChannel/rest/session/OneKColl
IColl:
http://localhost:8080/TestRestChannel/rest/session/OneIColl/0
It would return the data with index 0 in IColl.
4 Delete elements in session. Access URL.
Field:
http://localhost:8080/TestRestChannel/rest/session/ dataString
KColl:
http://localhost:8080/TestRestChannel/rest/session/OneKColl/ dataString
IColl:
http://localhost:8080/TestRestChannel/rest/session/OneIColl/0/ dataString
Go up to
Tasks