Hitachi Vantara Pentaho Community Forums
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: REST Client and HTTP_AUTHORIZATION header

  1. #1
    Join Date
    Jun 2016
    Posts
    181

    Default REST Client and HTTP_AUTHORIZATION header

    How to add header and value in REST Client?

    According the doc "The Headers tab enables you to define the content of any HTTP headers using an existing field. Populate the list of fields by clicking the Get fields button."

    So before calling "REST Client" I create "Add constants", I create "HTTP_AUTHORIZATION" and put some value in value field. In REST Client, Headers tab I get HTTP_AUTHORIZATION field (same Name).

    When execute I see that it does NOT sent this header to the sever (tried with different headers). More, I see that Pentaho itself is seanding ""HTTP_AUTHORIZATION" header (empty).

    How it works?

  2. #2
    Join Date
    Jun 2016
    Posts
    181

    Default

    ...probably "HTTP_AUTHORIZATION" is reserved for credentials entered in "Authentication" tab. Right? Custom headers will receive "HTTP_"+real header
    Like that, right?

  3. #3
    Join Date
    Jun 2016
    Posts
    181

    Default REST Client and parameters

    Hi,

    how to send parameters with POST in REST Client?

    I define field and value in "Add constants" then I use "parameters" tab to get this param and value.
    But nothing is send to sever - POST params are empty.

  4. #4
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    It doesn't appear to be adding anything...
    https://github.com/pentaho/pentaho-k...Rest.java#L159

  5. #5
    Join Date
    Jun 2016
    Posts
    181

    Default REST Client and parameters

    I define parameter and value in Add constants. Then in Rest Client, parameters tab I use this parameter to send it in POST method.
    But server receives nothing. POST is empty.
    What should I know?

  6. #6
    Join Date
    Aug 2011
    Posts
    236

    Default

    Hi Gosforth,

    Have you tried grabbing what you are sending the the authorization fields and putting it in your favorite browser. I think it should tell you if it's valid or what any issue is.

    Just a thought.
    PDI 8.0.0
    MySQL - 5.6.27
    Redshift - 1.0.1485
    PostgreSQL 8.0.2
    OS - Ubuntu 10.04.2

  7. #7
    Join Date
    Jun 2016
    Posts
    181

    Default

    I dot get what u mean. Answer is in my reply. This header is reserved and cannot be used in custom headers.

    Quote Originally Posted by tnewman View Post
    Hi Gosforth,

    Have you tried grabbing what you are sending the the authorization fields and putting it in your favorite browser. I think it should tell you if it's valid or what any issue is.

    Just a thought.

  8. #8
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Quote Originally Posted by Gosforth View Post
    I define parameter and value in Add constants. Then in Rest Client, parameters tab I use this parameter to send it in POST method.
    But server receives nothing. POST is empty.
    What should I know?
    Wait... Your transform goes:
    Add Constants -> REST Client
    And that's all?

    That won't work!
    Swap your "Add Constants" step for a Generate Rows step:
    Generate Rows -> REST Client

    Pretty much *EVERY* transformation needs to start with something from the "Input" folder, or it simply won't work (there are exceptions, but let's not go down that rabbit-hole, ok?)

  9. #9
    Join Date
    Jun 2016
    Posts
    181

    Default

    No, it fact this is slightly more advanced :-)

    Please take a look. No problems with headers ("HTTP_" is added by Apache I guess) but for some reason I cannot send parameters (depends type of content? Tried different settings...).
    I think I can send "body" and parameters with POST method.
    Attached Files Attached Files

  10. #10
    Join Date
    Jun 2016
    Posts
    181

    Default

    Gutlez, any idea how to make these parameters works?

Tags for this Thread

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.