In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
It has recently been found that things that have been done before will soon be forgotten without a firm grasp, so use these things to retain some test methods so that you can review them later.
The last test method of WebService is to write a script by hand to complete the test through the HTTP protocol. Although the script is handwritten here, most of the work is still done by copy and paste. It is very simple, and the following is a brief record.
In this way, like soap_request, it is a request to find the interface document and use these requests to write functions.
First, LR creates a script for the HTTP protocol.
Second, the script uses web_custom_request (); function, where the parameter url is the address of our weather forecast: http://webservice.webxml.com.cn/WebServices/WeatherWebService.asmx
Our request is in Method=POST,Body. The final code is as follows:
Web_custom_request ("web_custom_request"
"URL= http://webservice.webxml.com.cn/WebServices/WeatherWebService.asmx",
"Method=POST"
"TargetFrame="
"Resource=0"
"Referer="
"Body= Shanghai"
LAST)
This completes our web_custom_request () function
When we return the visit, there will be an error in the script:
Action.c (17): Error-26616: HTTP Status-Code=415 (Unsupported Media Type) for
"http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx" [MsgId: MERR-26616]
The reason for this error is that the packet we sent does not have a clear format type, and the server has an error when verifying the format, so we need to manually add a Header header and use the function web_add_header () to add web_add_header ("Content-Type").
"application/soap+xml; charset=utf-8")
So that you can run it again and you can succeed.
Careful students may find that in Shanghai
This is clearly the place to fill in the city, why is it filled in a pile of garbled codes?
This is because the format we send is in utf-8 format, so it also needs to be utf-8 encoded when sending city names, otherwise the server cannot recognize it. As for the conversion of utf-8 coding, you can search for utf-8 code conversion through Baidu.
This is the last way for LR to test webservice, and so far three have been done.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.