× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You should double check you're sending the proper content-type (which yours
is a GET and probably doesn't matter), response type (accept header) and
using the right endpoint. Double and triple check all of that. I've
worked with many systems like this and if it's not perfect, they will issue
a bad request.

Example, even if I use Accept */* and I'm expecting JSON, it will error out
on the server side, like your request is. I had to change it to
applicaton/json on the accept header for it to work.

This isn't an HTTPAPI issue at this point, so it seems.

You could also contact the trading partner and show then your request to
see if they are willing to offer insight on the issue.

Bradley V. Stone
www.bvstools.com
MAILTOOL Benefit #6 <https://www.bvstools.com/mailtool.html>: Easily send
group emails with Distribution Lists

On Wed, Aug 22, 2018 at 2:48 PM Mohammad Tanveer <surgum@xxxxxxxxx> wrote:

I am able to use the HTTP handler to add Authorization but it seems like
Bearer is not suppoted by APIs? its keep saying bad request if I don't
pass it then I get UNAUTHORIZED Response. Is there something else needs to
be added to the header to make it work?

Here is the http log..

HTTPAPI Ver 1.39 released 2018-03-09
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R2M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry : 10
DNS resolver options: x'00000136'
DNS default domain: mycom.COM
DNS server found: 10.35.21.150
DNS server found: 10.50.1.10
DNS server found: 10.35.19.50
Nagle's algorithm (TCP_NODELAY) disabled.
http_persist_req(GET) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(GET): entered
There are 0 cookies in the cache
GET

/customer-matching-service/v1/matching/finder?countryCode=US&addressLine1=4750+KIPLING+ST+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&postalCode=80033&customerName=CONOCOPHILLIPS%20COMPANY
HTTP/1.1
Host: dc2-mycom.com:11184
User-Agent: http-api/1.39
Accept-Encoding: gzip,deflate
Authorization: Bearer

eyJhbGciOiJIUzaWIiLCJjcmVhdGVkIjoxNDk0MjU1ODcxMjA4LCJuYW1lIjoiX0cyLjBDcmVkaXRBcHAiLCJ3YXJlaG91c2UiOm51bGwsImV4cCI6NTY4NTQwMDgwMCwiZW1haWwiOm51bGx9.vgr3dDDeKgQmaNXRAIA7pFWa-2CbVOUZZbtg9v1ZDpQKXd5VKmRVV46Ltc2wVj3UmU_CtkWky6EkkruQjH8O_Q


recvresp(): entered
HTTP/1.1 400 Bad Request
X-Powered-By: Servlet/3.1
X-Application-Context: customer-matching-service:dev:11184
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Language: en-US
Transfer-Encoding: chunked
Connection: Close
Date: Wed, 22 Aug 2018 19:39:02 GMT


SetError() #13: HTTP/1.1 400 Bad Request
recvresp(): end with 400
recvdoc parms: chunked 0
header_load_cookies() entered
recvchunk(): entered
get_chunk_size(): entered
0

chunk size = 0
get_chunk_size returned 0
SetError() #13: HTTP/1.1 400 Bad Request
http_close(): entered



On Tue, Aug 21, 2018 at 6:05 PM Mohammad Tanveer <surgum@xxxxxxxxx> wrote:

Anyone knows or have an example how to call http request using LIBHTTP
APIS using Authentication Type Bearer?

Or

How can we add header parameters?

Regards


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.