Skip to content

Commit

Permalink
Callout: Added authorization handler to example
Browse files Browse the repository at this point in the history
  • Loading branch information
jawills authored Dec 15, 2024
1 parent 6854904 commit 39061b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/content/apex/callout.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ public class AcmeApiCallout extends Callout {
.add(match.onSuccess(), action.logCallout(LoggingLevel.INFO))
.add(match.onSuccess(), action.returnJSON(responseType));
}
private class AcmeAPIAuthHandler implements Callout.Handler {
public Object handle(Callout c) {
c.setHeader('Authorization', 'Bearer XXX');
return null;
}
}
}
```

Expand Down Expand Up @@ -344,4 +351,4 @@ onAfterCallout()
# Change Log

### Ver. 1.0.1
* Fixed bug where CalloutException was not handled properly and resulted in framework returning null.
* Fixed bug where CalloutException was not handled properly and resulted in framework returning null.

0 comments on commit 39061b8

Please sign in to comment.