Home > database >  PB use MSXML2. ServerXMLHTTP way failed to send data
PB use MSXML2. ServerXMLHTTP way failed to send data

Time:09-15

Oleobject iole_http

Iole_http=create oleobject
Iole_http. Connecttonewobject (" MSXML2 ServerXMLHTTP ")
Iole_http. Settimeouts (00 10000100 00100 00600)

Try
Iole_http. Open (" POST ", ls_url, false)
Iole_http. Setrequestheader (" the content-type ", "application/x - WWW - form - urlencoded")
Iole_http. Setrequestheader (" the Content - Length ", string (ll_length))
Iole_http. Send (lblb_args)
The catch (runtimeerror rte)
Abnormal ls_err="request:" + rte. Getmessage ()
End the try

When executed, if and when the server network impassability, will send timeout failed, then how to obtain the failure reason, please? I use the rte. Getmessage () get to mean I send function call failure, as follows: Error: Error calling external object function the send at line 23 function in of_put_json of object n_pos_pay_le.
Rather than the error content of every body, the error of all body content is there any way to get to?

CodePudding user response:

This section in PB, nobody really? Alas!

CodePudding user response:

Lblb_args parameter value is how to

CodePudding user response:

//f_get_json_isbn

//https://api.douban.com/v2/book/isbn/9787543632608
//https://api.douban.com/v2/book/isbn/7543632608
Long ll_pos
Ll_pos=pos (as_isbn, '-')
The do while ll_pos & gt; 0
As_isbn=left (as_isbn ll_pos - 1) + mid (as_isbn, ll_pos + 1)
Ll_pos=pos (as_isbn, '-')
Loop


Blob lblb_args
String ls_headers
String ls_url
Long ll_length, ll_rest
Ls_url="https://api.douban.com/v2/book/isbn/" + as_isbn
String ls_data, ls_response

Ole OleObject lole_tenyear//statement
Lole_tenyear=CREATE oleobject
Lole_tenyear. ConnectToNewObject (" Microsoft. XMLHttp ")//help XMLHttp component, I tested xp and Windows 7 are shipped, do not need to install any auxiliary software such as.net environment

Lole_tenyear. Open (" POST ", ls_url, false)//parameter explanation see:
//http://blog.csdn.net/ldl22847/article/details/9662927

Lole_tenyear. SetRequestHeader (" the content-type ", "application/x - WWW - form - urlencoded")
Lole_tenyear. SetRequestHeader (' Content - Length, the string (len (ls_data)))
//lole_tenyear. Send (')
Lole_tenyear. Send (ls_data)//the key is this step: if your browser HTTPS environment is not installed the roots of certification certificates, must be an error, if you apply for to install the authority such as verisign hair root certificate, use ie to open the top of the HTTPS, wouldn't the red warning (ask if you continue to), but the pb not prompt if you continue, direct error exit, verisign certificate a year like 10000-100000 yuan fee, here if you want to test, you can change the HTTPS address to https://www.alipay.com/(alipay), not an error, note: this certificate and validation are one-way authentication, not a two-way,
The do While lole_tenyear. ReadyState & lt;> 4//'query condition, delay
The yield ()
Loop
Ls_response=lole_tenyear. The responseText//returns the
//messagebox (ls_url, ls_response)

IF lole_tenyear. The Status & gt; THEN=300
//MessageBox (" HTTP request failed: ", lole_tenyear. StatusText, the Exclamation! , OK!
END the IF


Destroy lole_tenyear
Return ls_response

CodePudding user response:

Open the IE to see if can get to the Internet, and thus the IE offline will prompt this
  • Related