Echo allows you to return a desired value.
Overview / explanation of the different options, links to github code.
  • ​ECHO Get: echo://${returnvalue} - where return value is a base64 string. const returnvalue = Buffer.from("My return value").toString('base64')
  • ​ECHO+JSON Get: echo+json://name/${returnvalue}, const returnvalue = Buffer.from('{"name":"Tal Muskal"}').toString('base64')
  • ​ECHO+JSON Post: echo+post+json://timestamp/${body}/${content} - where body is const body = Buffer.from('{"block_num_or_id":"36568000"}').toString('base64'). In this example you specify the type of request: echo+post+json then the key mapping timestamp then the body of the POST request, encoded in base64, then the URL path const content = Buffer.from('{"timestamp":"2019-01-09T18:20:23.000"}').toString('base64');.
Copy link