@send.register(urllib_request.OpenerDirector)<EOL>def _urllib_send(opener, req, **kwargs):
if req.content and not any(h.lower() == '<STR_LIT>'<EOL>for h in req.headers):<EOL><INDENT>req = req.with_headers({'<STR_LIT:Content-Type>': '<STR_LIT>'})<EOL><DEDENT>url = req.url + '<STR_LIT:?>' + urlencode(req.params)<EOL>raw_req = urllib_request.Request(url, req.content, headers=req.headers)<EOL>set_urllib_method(raw_req, req.method)<EOL>try:<EOL><INDENT>res = opener.open(raw_req, **kwargs)<EOL><DEDENT>except urllib_http_error_cls as http_err:<EOL><INDENT>res = http_err<EOL><DEDENT>return Response(res.getcode(), content=res.read(), headers=res.headers)<EOL>
Send a request with an :mod:`urllib` opener