mirror of
https://github.com/sasjs/core.git
synced 2025-12-10 14:04:36 +00:00
fix: re-attempt of request, hopefully fixes #400
This commit is contained in:
@@ -114,6 +114,17 @@ options noquotelenmax;
|
||||
headers "Authorization"="Bearer &&&access_token_var";
|
||||
%end;
|
||||
run;
|
||||
%if &SYS_PROCHTTP_STATUS_CODE=401 %then %do;
|
||||
/* relates to: https://github.com/sasjs/core/issues/400 */
|
||||
%put 401 thrown in &sysmacroname;
|
||||
%put sleeping: %sysfunc(sleep(10,1)) - will try once more;
|
||||
proc http method='GET' out=&fname1 &oauth_bearer
|
||||
url="&base_uri/folders/folders/@item?path=&newpath";
|
||||
%if &grant_type=authorization_code %then %do;
|
||||
headers "Authorization"="Bearer &&&access_token_var";
|
||||
%end;
|
||||
run;
|
||||
%end;
|
||||
%local libref1;
|
||||
%let libref1=%mf_getuniquelibref();
|
||||
libname &libref1 JSON fileref=&fname1;
|
||||
@@ -121,7 +132,7 @@ options noquotelenmax;
|
||||
iftrue=(
|
||||
&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 404
|
||||
)
|
||||
,mac=&sysmacroname
|
||||
,mac=mv_createfolder124
|
||||
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
||||
)
|
||||
%if &mdebug=1 %then %do;
|
||||
|
||||
Reference in New Issue
Block a user