1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-14 03:50:06 +00:00

Merge pull request #402 from sasjs/issue400

fix: re-attempt of request, hopefully fixes #400
This commit is contained in:
Allan Bowe
2025-06-30 17:38:39 +01:00
committed by GitHub
3 changed files with 26 additions and 4 deletions

15
all.sas
View File

@@ -11943,7 +11943,7 @@ data _null_;
run; run;
/* END */ /* END */
%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run; *%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
%mend mp_replace; %mend mp_replace;
/** /**
@@ -24661,6 +24661,17 @@ options noquotelenmax;
headers "Authorization"="Bearer &&&access_token_var"; headers "Authorization"="Bearer &&&access_token_var";
%end; %end;
run; 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; %local libref1;
%let libref1=%mf_getuniquelibref(); %let libref1=%mf_getuniquelibref();
libname &libref1 JSON fileref=&fname1; libname &libref1 JSON fileref=&fname1;
@@ -24668,7 +24679,7 @@ options noquotelenmax;
iftrue=( iftrue=(
&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 404 &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) ,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
) )
%if &mdebug=1 %then %do; %if &mdebug=1 %then %do;

View File

@@ -148,6 +148,6 @@ data _null_;
run; run;
/* END */ /* END */
%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run; *%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
%mend mp_replace; %mend mp_replace;

View File

@@ -114,6 +114,17 @@ options noquotelenmax;
headers "Authorization"="Bearer &&&access_token_var"; headers "Authorization"="Bearer &&&access_token_var";
%end; %end;
run; 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; %local libref1;
%let libref1=%mf_getuniquelibref(); %let libref1=%mf_getuniquelibref();
libname &libref1 JSON fileref=&fname1; libname &libref1 JSON fileref=&fname1;
@@ -121,7 +132,7 @@ options noquotelenmax;
iftrue=( iftrue=(
&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 404 &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) ,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
) )
%if &mdebug=1 %then %do; %if &mdebug=1 %then %do;