Consume Azure ML Web Service with Postman: how to pass arguments?

Lauri Lehman 136 Reputation points
2020-10-29T09:55:00.457+00:00

Is it possible to pass parameters to an Azure ML Web Service with Postman? I created an R web service endpoint that runs in an Azure Container Instance. My run function has one argument ("data"). I can call the web service using Azure ML R SDK (using invoke_webservice()) and the input parameter is read successfully from the request content. The input is constructed like:

toJSON(data.frame(data="This is my test string"))

Result:

[{"data": "This is my test string"}]

If I create a Postman request and copy the input to the request body, the input parameter is not passed to the web service. The web service can return a static output to Postman but the variable data is always empty. Is this a property of the ML Web Service? If not, how can I set up the request body so that the argument is read successfully? I have tried many variations, but none have worked.

I have set content-type header to application/json. I don't have authentication in the web service, since it is just a test instance.

Ultimately, we need to call the web service with C# from Azure Function. I know that we can use the C# template from documentation and it can probably pass the parameter to the web service, but it would be nice to be able to test the web service with Postman.

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,563 questions
0 comments No comments
{count} vote

Accepted answer
  1. Chifeng Cai 81 Reputation points
    2020-10-29T12:55:26.077+00:00

    Try this in postman.

    35960-postman.png

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful