Created
May 3, 2022 17:49
-
-
Save waltervargas/9519e5ce9df8b0eb36cc0456ea5dab56 to your computer and use it in GitHub Desktop.
REST request from PLSQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION restful.put(auri character varying, ajson_text text) | |
RETURNS text | |
LANGUAGE plperlu | |
SECURITY DEFINER | |
AS $function$ | |
use REST::Client; | |
use Encode qw(encode); | |
my $client = REST::Client->new(); | |
$client->getUseragent()->proxy( 'https', 'http://some-proxy/' ); # use for proxy authentication | |
$client->addHeader('Content-Type', 'application/json'); # headers | |
$client->POST( $_[0], encode('UTF-8', $_[1])); # encoding | |
return $client->responseContent(); | |
$function$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment