2
$\begingroup$

I have a very simple question. I don't know how to pass multiple parameters to a web deployed APIFunction.

I created a function:

func = APIFunction[{"t" -> "Real", "y"->"Real"}, #t*#y &];
api = CloudDeploy[func, Permissions -> "Public"]   

and Mathematica gave me the link to the webdeployed function. I know that I can pass a single parameter by just adding ?{Parameter} to the url. But what do I have to do, to pass t and y?

I couldn't find it.

Thank you very much!

$\endgroup$
  • 2
    $\begingroup$ Just use yourURL?t=1.1&y=3.2 $\endgroup$ – Carl Woll Nov 4 '17 at 2:58
1
$\begingroup$
func = APIFunction[{"t" -> "Real", "y"->"Real"}, #t*#y &];
api = CloudDeploy[func, Permissions -> "Public"]   

You don't need to access it via browser. There are functions for that:

URLExecute[api, {"t" -> 1, "y" -> 5}]
5.

But if you insist:

URLBuild[First@api, {"t" -> 1, "y" -> 5}] // Echo // SystemOpen

>> https://www.wolframcloud.com/...........?t=1&y=5

$\endgroup$

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.