HTTPãµãŒãã¹
AuthSafeãšã³ããã€ã³ããžã®èªèšŒæžã¿APIãªã¯ãšã¹ããè¡ãããã®HTTPã¯ã©ã€ã¢ã³ãã©ãããŒã
æŠèŠ
HttpServiceã¯ãAxiosãã©ãããã䟿å©ãªHTTPãªã¯ãšã¹ãçšã©ã€ãã©ãªã§ããã¢ã©ãŒããŒã¯ã³ã®èªåæ¿å ¥ãšãšã©ãŒåŠçæ©èœãåããŠããŸããããŒã¹URLãContent-TypeãCache-ControlãAuthorizationããããŒããããããèšå®ãããŠãããããã©ã«ãã®ã¿ã€ã ã¢ãŠãã¯10ç§ã§ãã
åºæ¬çãªäœ¿ãæ¹
import { HttpService } from 'authsafe-ts';
const user = await oauthService.getUser();
const httpService = new HttpService(user?.access_token);
const userInfo = await httpService.get('/auth/userinfo');