0

I'm using an IBM Cloud Functions web action but can not access the parameters.

Parameters: enter image description here

Code:

function main(params) {

module = params.module;
attribute = params.attribute;

var options = {
        method: 'POST',
        uri: params.uri,
        headers: {
            'Content-Type': 'application/json; charset=utf-8',
        },
        body: {
            module: module
        },
        json: true
    };

    console.log(options);
    return { message: options };
}

IBM Cloud Functions Output:

enter image description here

Postman Output

enter image description here

jpsstack
  • 1,221
  • 4
  • 18
  • 29
  • How do you invoke action? It seems that you defined it as web action. Have you tried leaving out the quotes in your form? – data_henrik May 02 '19 at 05:36
  • I invoke it directly in the browser. Yes, it's a web action. Leaving out the quotes in not possible as I wouldn't be able to save the parameters. I also added the Postman output. – jpsstack May 02 '19 at 09:26
  • when your functions returns just params, what is the output? – data_henrik May 02 '19 at 09:46
  • it's working now for some reason , after returning params as advised. I didn't change anything else. – jpsstack May 02 '19 at 10:24

1 Answers1

0

Remove the quotations from the parameter name field, then try it again. it works for me.Parameters

TAMETA2009
  • 11
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 03 '22 at 18:55
  • You can find more information on how to authenticate IBM parameters on [https://www.youtube.com/watch?v=dDCIz2bbv0I&t=265s] – TAMETA2009 Jul 04 '22 at 15:33