Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Rest Client JSON application type and PUT method returns 415-Unsupported media type

  1. #1
    Join Date
    Nov 2015
    Posts
    4

    Default Rest Client JSON application type and PUT method returns 415-Unsupported media type

    Hi, I'm using PDI-7.0 and trying to call a REST Web Service with REST Client with method PUT, JSON application type. It fails with response code 415.
    The Content-Type and Authorization are added in the REST Client headers and the request body string is JSON format. Do not know why it still returns 415-Unsupported media type.


    In my transformation, all the required fields are defined in the modified script that is before the REST Client.


    modified java script:
    var type = "application/json";
    var auth = "Basic cm9vdDpyb290MTIzNEA=";
    var url = 'http://localhost:8080/dm-rest-services/api/accounts/2148/userdefinedpages/ACCOUNTINFO/data/11';
    var bd = '{"tableName": "ACCOUNTINFO","rowId": 11,"userDefinedData": [{"fieldName": "UDEFACCOUNTBALANCE","fieldValue": 550}]}';


    REST Client
    General tab
    Accept URL from field => checked
    URL field => url
    HTTP Method => PUT
    Body field => bd (In JSON format and defined in modifed java script step)
    Application type =>JSON

    Headers tab
    Field | Name
    type|Content-Type
    auth|Authorization

    Name:  fields-token.jpg
Views: 1125
Size:  18.4 KB
    Name:  rest-client-general.jpg
Views: 1159
Size:  16.9 KB
    Name:  rest-client-header.jpg
Views: 1116
Size:  13.7 KB
    Name:  Error.jpg
Views: 1115
Size:  23.0 KB

  2. #2
    Join Date
    Nov 2015
    Posts
    4

    Default Rest Client JSON application type and PUT method returns 415-Unsupported media type

    Hi, I'm using PDI-7.0 and trying to call a REST Web Service with REST Client with method PUT, JSON application type. It fails with response code 415.
    I have Content-Type and Authorization added in the REST Client headers and the request body string is JSON format. Do not know why it still returns 415-Unsupported media type.


    In my transformation, all the required fields are defined in the modified script that is before the REST Client.


    modified java script:
    var type = "application/json";
    var auth = "Basic cm9vdDpyb290MTIzNEA=";
    var url = 'http://localhost:8080/dm-rest-services/api/accounts/2148/userdefinedpages/ACCOUNTINFO/data/11';
    var bd = '{"tableName": "ACCOUNTINFO","rowId": 11,"userDefinedData": [{"fieldName": "UDEFACCOUNTBALANCE","fieldValue": 550}]}';


    REST Client
    General tab
    Accept URL from field => checked
    URL field => url
    HTTP Method => PUT
    Body field => bd (In JSON format and defined in modifed java script step)
    Application type =>JSON


    Headers tab
    Field | Name
    type|Content-Type
    auth|Authorization
    Attached Images Attached Images     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.