Adding Auth Key to HTTP Header

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
mbwswim
Posts: 1
Joined: Mon Sep 20, 2021 11:23 pm

Adding Auth Key to HTTP Header

Post by mbwswim »

I read a few posts on this and it was nto clear enough to me.
Some said to use HTTP _ADDL_HEADER or something like that and that is not active in HTTPAPI.
So I do not know what to use to send my auth key.
I can do this in postman, so I know it works, I just can't here and we want to get the data on to ibmi.
Scott Klement
Site Admin
Posts: 670
Joined: Sun Jul 04, 2021 5:12 am

Re: Adding Auth Key to HTTP Header

Post by Scott Klement »

Can you explain a little more? There are lots of different types of authentication. What are you trying to do?
jonboy49
Posts: 207
Joined: Wed Jul 28, 2021 8:18 pm

Re: Adding Auth Key to HTTP Header

Post by jonboy49 »

Perhaps if you showed us what you are sending with Postman we could understand the type of authentication you are trying to do.
JJDalglish
Posts: 4
Joined: Wed Oct 06, 2021 10:32 pm

Re: Adding Auth Key to HTTP Header

Post by JJDalglish »

I know the below example is in curl, but since I don't how how to do it using HTTP, that is all I can provide right now.

Using HTTP, I'd like to know how to pass these values:
X-API-Key:
Return-Request:
Return-Response:


--------------------------

curl --location --request POST 'https://try-test.anysportsapi.com/department/create' \
--header 'X-API-Key: akdalsda9das8d980da0dasda' \
--header 'Return-Request: 0' \
--header 'Return-Response: 1' \
--header 'Content-Type: application/json' \
--data-raw '{"id": "9998","name": "Test Department 9998"}'



Thanks!
jonboy49
Posts: 207
Joined: Wed Jul 28, 2021 8:18 pm

Re: Adding Auth Key to HTTP Header

Post by jonboy49 »

Take a look at this post - it shows how to add such headers.

viewtopic.php?p=97#p97
JJDalglish
Posts: 4
Joined: Wed Oct 06, 2021 10:32 pm

Re: Adding Auth Key to HTTP Header

Post by JJDalglish »

THANK YOU !!!!!!!!!!
Post Reply