Showing results for 
Search instead for 
Did you mean: 
New Member

HTTP Request to Azure Machine Learning Web Services

Hi all,


I would like to use Flow to call a web service but I am getting the error:

No request body provided or error in deserializing the request body.


I have trained classifier using Azure Machine Learning Studio and am able to call it in Python through a web request. The code for this is below. However I would like to be able to call this web request using Flow. I cannot seem to get it right.



import urllib.request
import json

data = {
        "Inputs": {
                            'Subject_Tag_00': "delete",   
                            'Subject_Tag_01': "recycle",   
                            'Subject_Tag_02': "bin",   
                            'Body_Tag_00': "N/A",   
                            'Body_Tag_01': "N/A",   
                            'Body_Tag_02': "N/A",   
                            'Body_Tag_03': "N/A",   
                            'Body_Tag_04': "N/A",   
                            'Answer': "",   
    "GlobalParameters":  {

body = str.encode(json.dumps(data))

url = 'Uri from the second image in this post'
api_key = 'Primary Key from the second image in this post' 
headers = {'Content-Type':'application/json', 'Authorization':('Bearer '+ api_key)}

req = urllib.request.Request(url, body, headers)

    response = urllib.request.urlopen(req)

    result =
except urllib.error.HTTPError as error:
    print("The request failed with status code: " + str(error.code))

    # Print the headers - they include the requert ID and the timestamp, which are useful for debugging the failure
    print(json.loads("utf8", 'ignore')))


This is the error I receive when making the request through Flow is:

  "error": {
    "code": "BadArgument",
    "message": "Invalid argument provided.",
    "details": [
        "code": "RequestBodyInvalid",
        "message": "No request body provided or error in deserializing the request body."

I have tried a number of different formats for the body of the request. Below isa picture of one of them.



I am getting my info from this page.


I think the error is about how I am formatting the body of the request but I am not sure.  Does anyone have any insight into this?


Thank you,




Super User II
Super User II

Hi @ClintonWalsh 

I just stumbled on your request. You've been waiting a while for a reply.

Were you able to solve it? Can you post the solution so that we can all learn from it?

If you still need help, please let me know what changed.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.


Helpful resources

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.


Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (4,759)