1

I am trying to call a third party REST API that I developed using spring boot, and I want to call a function(param1,param2) in the API from the oracle using the oraclize_query() (POST request), but I kind of don't know how to pass the parameters in oraclize_query()!!

1

To pass POST requests from Oraclize, you can pass an additional parameter as the data you want to POST.

Example:

oraclize_query("URL","json(https://api.postcodes.io/postcodes).status",
              '{"postcodes" : ["OX49 5NU", "M32 0JG", "NE30 1DP"]}');

...where the additional passed ('{"postcodes" : ["OX49 5NU", "M32 0JG", "NE30 1DP"]}') represents POST data.

Your API's route manager should pass the proper parameters to the function.

| improve this answer | |
  • thank you for your answer! but I want to pass some variables and not static data in the query, do you have any idea how to do so. – EL Idrissi Yazami Younes Jul 9 '18 at 15:25
  • @ELIdrissiYazamiYounes At the end of the day, the data you pass has ends up in some static form. Consider converting the data to a string before passing the data. – ReyHaynes Jul 9 '18 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.