Python中以下代码的等价物是什么? 更具体地说,在Python中寻找HivpEntity的等价物。其余的我想通了。我正在使用urllib2 python模块。
String checkInUrl = serverURL+"resources/slmservices/fcs/commit";
URIBuilder checkInBuilder = new URIBuilder(checkInUrl.replace(" ", "%20"));
URI checkInUri = checkInBuilder.build();
checkinTicket = "sdfsfsdfsfsfweafdaewfw"
HttpEntity checkInReqEntitiy = new StringEntity(checkinTicket);
HttpRequestBasecheckInRequest=reMethod.getRequest(checkInUri,checkInReqEntitiy);
checkInRequest.addHeader("ticket", ticket);
HttpResponse checkInResponse = httpclient.execute(checkInRequest);
HttpEntity checkInResponseEntity = checkInResponse.getEntity();
StatusLine checkInResponseStatus = checkInResponse.getStatusLine();
答案 0 :(得分:0)
看起来类似于urllib2.Request: https://docs.python.org/2/library/urllib2.html#urllib2.Request