3
所以,我想使用谷歌URL縮短API和我嘗試使用PROC HTTP與HTTPS URL
proc http
所以,當我運行這段代碼
filename req "D:\input.txt";
filename resp "D:\output.txt";
proc http
url="https://www.googleapis.com/urlshortener/v1/url"
method="POST"
in=req
ct="application/JSON"
out=resp
;run;
(其中d:\ input.txt看起來像{「longUrl」:「http://www.myurl.com」})一切正常工作在我家SAS基地9.3。但是,在工作上,在EG 4.3上,我得到:
NOTE: The SAS System stopped processing this step because of errors.
並且不可能調試。谷歌搜索後,我發現,我必須這樣設置
-jreoptions (-Djavax.net.ssl.trustStore=full-path-to-the-trust-store -Djavax.net.ssl.trustStorePassword=trustStorePassword)
但是,在那裏我可以得到「服務的證書被信任」 Java系統選項 - 和密碼呢?
編輯:正如我在下面的評論中注意到的,我的工作SAS安裝到服務器中,所以我沒有直接訪問配置。另外,更改服務器配置不是個好主意。所以,我嘗試谷歌更多,並找到美麗的解決方案使用cUrl,沒有X命令(導致它阻止在我的EG)。等效語法是:
filename test pipe 'curl -X POST -d @D:\input.txt https://www.googleapis.com/urlshortener/v1/url --header "Content-Type:application/json"';
data _null_;
infile test missover lrecl= 32000;
input ;
file resp;
put _infile_;
run;
希望它可以幫助別人
注意EG 4.3是不完全與SAS版本 - 它通常是SAS 9.2,雖然它可能與更高版本或更早版本。 – Joe
是的,謝謝,我知道 - 但proc http適用於我的EG 4.3沒有問題與http基址url – burduk
我明白,我只是說更有用的溝通是SAS版本,而不是EG版本。 – Joe