The urlliB2 module of Python is used to obtain the data code as follows:
Try:
data = urllib2.urlopen(url).read()
except Exception,e:
print e
return data
Url parameter is:
http://sms.gildata.com:8080/sms/sendSms.do?content=Hello world&msisdns=18373239087&user=gildata2&key=804
The following problems occurred while executing the code:
HTTP Error 505: the HTTP Version Not Supported
online are urllib2 module does Not support http1.1 agreement, must carry on the processing of one sort or another, but I later found out that seems to be the url does Not support Spaces, I will Hello world this parameter Spaces take out, can successfully send text messages to come out, if it is in space can be used to add escape character % 20 instead of Spaces, you can also use % 0 a instead of a newline.
Read More:
- Alicloud CentOS 5 old version yum/ repomd.xml : [Errno 14] HTTP Error 404: Not Found
- urlopen error unknown url type:httpë/HTTP Error 400:Bad Request
- HTTP error code compact version
- Python crawler: urllib.error.HTTPError : HTTP Error 404: Not Found
- An Ajax HTTP error occurred in drupal7 installation occurred.HTTP Result Code
- Error parsing HTTP request header Note: further occurrences of HTTP header p
- Springboot project: error parsing HTTP request header note: further occurrences of HTTP request parsing
- The Excel connection manager is not supported in the 64-bit version of SSIS [Switch]
- urllib2.HTTPError: HTTP Error 403: Forbidden
- objs/addon/ngx_http_proxy_connect_module-master/ngx_http_proxy_connect_module.o] Error 1
- [How to Solve] ashx Http Delete method not allowed
- Python crawler urllib.error.HTTPError : HTTP Error 418:
- The python version output from the command line is inconsistent with the python version in the current CONDA environment
- raise HTTPError(req.full_url, code, msg, hdrs, fp)urllib.error.HTTPError: HTTP Error 404: Not Found
- Nginx Error:HTTP 1.0 client does not support chunked response
- failed to open stream: HTTP wrapper does not support writeable connections
- Err:1 http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu xxxxxx 404 Not Found [IP: 101.6.8.193 80]
- Python error: typeerror: not supported between instances of ‘STR’ and ‘Int’
- HTTP error 405.0 – method not allowed solution for put and delete operations of rest Service on iis7.5
- error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)