0

I want to pass parameters to an url using post method in hyperledger composer, but i didn't found any example of it. I only found one example in sample code of composer..

 function handlePost(postTransaction) {
 var url = 'https://composer-node-red.mybluemix.net/compute';

  return post( url, postTransaction)
  .then(function (result) {
    // alert(JSON.stringify(result));
      postTransaction.asset.value = 'Count is ' + result.body.sum;
      return getAssetRegistry('org.example.sample.SampleAsset')
      .then(function (assetRegistry) {
          return assetRegistry.update(postTransaction.asset);
      });
  });

}

In third parameter of post method how should i pass the objects.for example in above i want to pass postTransaction.asset.value to the specified url.. url string
The URL to post the data to

typed Typed
The typed instance to be posted. The instance will be serialized to JSON.

options object
The options that are passed to Serializer.toJSON

i want to use option parameter...

Akshay Indalkar
  • 359
  • 2
  • 12

1 Answers1

0

There is now an experimental feature in the Composer code to solve this problem - the post you are using can be replaced by using the request module from NodeJS The details are in the following 2 docs on Github:

https://github.com/hyperledger/composer/issues/3092

https://github.com/hyperledger/composer/pull/3600

R Thatcher
  • 5,550
  • 1
  • 7
  • 15