PB 通過http協議以POST方式將XML傳送到協議伺服器
阿新 • • 發佈:2018-12-31
------解決方案--------------------------------------------------------
Blob lblb_args
String ls_header
String ls_url
String ls_args
long ll_length
integer li_rc
inet iinet_base,iinet
//internetresult ir
iinet_base = create inet
iinet = create inet
li_rc = GetContextService( "Internet", iinet_base )
IF li_rc = 1 THEN
ir = CREATE n_cst_internet
ls_url = " http://xxx.com/getinfo.asp?"
ls_args = "var1=tr&var2=tttt&var3=&var4=r&var5=&var6=&var7=tttt&var8=&var9=&var10=ttt&var11="
lblb_args = Blob( ls_args )
ll_length = Len( lblb_args )
ls_header = "Content-Type: " + &
"application/x-www-form-urlencoded~n" + &
"Content-Length: " + String( ll_length ) + "~n~n"
li_rc = iinet.PostURL( ls_url, lblb_args, ls_header, ir )
messagebox('',string(li_rc))
END IF
integer li_filenum
li_filenum = fileopen('c:\1.html',textmode!,write!,shared!,replace!,encodingUTF8!)
filewriteex(li_filenum,ir.is_data)
fileclose(li_filenum)
ole_1.object.navigate('c:\1.html')
destroy iinet_base
destroy iinet
destroy ir
Blob lblb_args
String ls_header
String ls_url
String ls_args
long ll_length
integer li_rc
inet iinet_base,iinet
//internetresult ir
iinet_base = create inet
iinet = create inet
li_rc = GetContextService( "Internet", iinet_base )
IF li_rc = 1 THEN
ir = CREATE n_cst_internet
ls_url = "
ls_args = "var1=tr&var2=tttt&var3=&var4=r&var5=&var6=&var7=tttt&var8=&var9=&var10=ttt&var11="
lblb_args = Blob( ls_args )
ll_length = Len( lblb_args )
ls_header = "Content-Type: " + &
"application/x-www-form-urlencoded~n" + &
"Content-Length: " + String( ll_length ) + "~n~n"
li_rc = iinet.PostURL( ls_url, lblb_args, ls_header, ir )
messagebox('',string(li_rc))
END IF
integer li_filenum
li_filenum = fileopen('c:\1.html',textmode!,write!,shared!,replace!,encodingUTF8!)
filewriteex(li_filenum,ir.is_data)
fileclose(li_filenum)
ole_1.object.navigate('c:\1.html')
destroy iinet_base
destroy iinet
destroy ir