Skip to Content

Unable to pass credentials while consuming a REST-service

Feb 27 at 07:11 AM


avatar image
Former Member


I'm consuming a REST-service from an ABAP-program.

Managed to connect to the service, providing my User-ID & Password via the pop-up.

Now I want to connect to the service directly, without entering my credentials.

So, I suppress the pop-up using:

  • lo_http_client->propertytype_logon_popup = lo_http_client->co_disabled

And provide my credentials via:

  • lo_http_client->authenticate( username = lv_user password = lv_password ).

But the response I get contains:

  • "401 - Unauthorized: Access is denied due to invalid credentials."

Is this the correct way to implement the call?

Thanks in advance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Mar 01 at 01:23 PM

Solved it, by using cl_http_client=>create_by_destination instead of cl_http_client=>create_by_url.

And creating the destination via SM59 offcourse.

10 |10000 characters needed characters left characters exceeded