none
R code & model as objects, inputs/outputs as dataframe RRS feed

  • Question

  • Hey I try to get up the example 5 of:

    https://docs.microsoft.com/en-us/machine-learning-server/operationalize/how-to-deploy-web-service-publish-manage-in-r

    The R part work fine but when I try to test with POSTMAN the REST API  I get a error 400 

    {
       "Link": "https://go.microsoft.com/fwlink/?linkid=830136",
       "Message": "The value {\n  \"mpg\": \"21.0\",\n  \"cyl\": \"6\",\n  \"disp\": \"160\",\n  \"hp\": \"110\",\n  \"drat\": \"3.90\",\n  \"wt\": \"2.620\",\n  \"qsec\": \"216.46\",\n  \"vs\": \"0\",\n  \"am\": \"1\",\n  \"gear\": \"4\",\n  \"carb\": \"4\"\n} cannot be converted to type data.frame",
       "ExceptionType": "ArgumentException"
    }

    Any idea what goes wrong ......

    Wednesday, August 29, 2018 9:30 PM

All replies

  • What data types are you using in your publishService() function.

    The documentation mentions that the following types are supported:

    numeric, integer, logical, character, vector, matrix and data.frame

    https://docs.microsoft.com/en-us/machine-learning-server/operationalize/how-to-deploy-web-service-publish-manage-in-r

    Can you paste code for your publishService() function below?

    Thanks!

    Wednesday, August 29, 2018 11:37 PM
  • Hello,

    The R part work fine but when I try to test with POSTMAN the REST API  I get a error 400

    Perhaps the discrepancy is a header content-type or something similar?

    Is it possible to:

    1. Share The payload of the HTTP request including the headers, ect.... in POSTMAN

    2. check that the content-type == application/json

    3. Perhaps turn on some logging on the R side if using mrsdeploy such that you can see the successful request payload and diff that up to POSTMAN. 

    You can do this by dropping this line in before making any api calls and it will print out all the request info:

    options('mrsdeploy.verbose'=TRUE)


    Let us know how it goes.

    Regards,

    Sean


    Thursday, August 30, 2018 2:57 PM