Skip to content

Instantly share code, notes, and snippets.

@Downes
Created December 2, 2018 20:15
Show Gist options
  • Select an option

  • Save Downes/c3fbe6f0e2e6042970d5fdd2b99e76b9 to your computer and use it in GitHub Desktop.

Select an option

Save Downes/c3fbe6f0e2e6042970d5fdd2b99e76b9 to your computer and use it in GitHub Desktop.
Create Issuer API request for Badgr in Perl
# Create Request JSON
my $issuer_json = qq|{
"name": "$issuer->{name}",
"email": "$issuer->{email}",
"description": "$issuer->{description}",
"url": "$issuer->{url}"
}|;
# Format Request
my $create_issuer_url = $self->{badgr_url}."/v2/issuers";
my $header = ['Authorization' => 'Bearer '.$self->{access_token},"Content-Type" => "application/json"];
my $req = HTTP::Request->new('POST', $create_issuer_url, $header, $issuer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment