Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

apex_web_service - POST using headers and body

CJ BellJan 6 2020 — edited Jan 7 2020

Hi

I have used apex_web_service successfully where the authentication key was i the URL

one of our providers how uses the header method for authentication

I have got to the stage where it is authentication ok but I'm struggling with the actual POST

This is an example in Node.JS is this possible in Oracle ??

pastedImage_0.png

This is what I have so far

begin

    apex\_web\_service.g\_request\_headers.delete;

    apex\_web\_service.g\_request\_headers(1).name  := 'Authorization';

    apex\_web\_service.g\_request\_headers(1).value := 'Bearer XXX API KEY XXX';

    v\_url := '[https://api.fullcontact.com/v3/person.enrich?email=email@test.com';](https://api.fullcontact.com/v3/person.enrich?email=email@test.com';)[//api.fullcontact.com/v3/person.enrich?email=email@test.com](mailto://api.fullcontact.com/v3/person.enrich?email=email@test.com)';

    l\_response := apex\_web\_service.make\_rest\_request(v\_url, p\_http\_method => 'POST' );

    insert into visits\_response (source,abandonment) values ('TEST\_URL',l\_response);

end;

the return from this is

pastedImage_2.png

just struggling on how to put the actual body request in there

I have looked at the params variable but really don't know how to put them in

Any help greatly appreciated as this is proving to be a lengthy struggle :-(

Thanks

Chris

This post has been answered by Pavel_p on Jan 6 2020
Jump to Answer
Comments
Post Details
Added on Jan 6 2020
6 comments
8,606 views