http-post

urllib2 POST progress monitoring

纵饮孤独 提交于 2019-11-27 11:23:01
问题 I'm uploading a fairly large file with urllib2 to a server-side script via POST. I want to display a progress indicator that shows the current upload progress. Is there a hook or a callback provided by urllib2 that allows me to monitor upload progress? I know that you can do it with download using successive calls to the connection's read() method, but I don't see a write() method, you just add data to the request. 回答1: It is possible but you need to do a few things: Fake out the urllib2

How to mimic an HTML form submission in a POST request?

廉价感情. 提交于 2019-11-27 10:36:07
问题 I have HTML form that is used for sending bugreports from application to server. I need to mimic this behavior programmatically. What will the corresponding POST request (or series of requests) look like? <form name="bugreport" method="post" enctype="multipart/form-data" action="http://my-server.com/bugreport.php"> <div name="SentData"> <textarea name="logfile" class="UserVisible"></textarea><br> <textarea name="configfile" class="UserVisible"></textarea><br> </div> <textarea name=

What is the difference between [AcceptVerbs(HttpVerbs.Post)] and [HttpPost]?

混江龙づ霸主 提交于 2019-11-27 10:13:05
问题 I can decorate an action either with the [AcceptVerbs(HttpVerbs.Post)]/[AcceptVerbs(HttpVerbs.Get)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(string title) { // Do Something... } or with the [HttpPost]/[HttpGet] attributes [HttpPost] public ActionResult Create(string title) { // Do Something... } Are they different? 回答1: Nothing. One is just shorthand for the other. 回答2: [HttpPost] is shorthand for [AcceptVerbs(HttpVerbs.Post)] . The only difference is that you can't use

How to send multiple parameterts to PHP server in HTTP post

戏子无情 提交于 2019-11-27 09:37:45
I'm sending base64 string to php server and its working well. Now I want to send another parameter as a string. Can anyone tell me what code need to add in below code. Below code is working good for single parameter. How can we modify it for multiple parameters? NSData *data = [UIImageJPEGRepresentation(imgeview.image,90) base64Encoding]; // Create your request string with parameter name as defined in PHP file NSString *myRequestString = [NSString stringWithFormat:@"question_image=%@",data]; myRequestString = [myRequestString stringByReplacingOccurrencesOfString: @"+" withString:@"%2B"]; //

ASP.NET File Upload

独自空忆成欢 提交于 2019-11-27 09:08:06
I am trying to make a server page (C#, asp.net 2.0+) to save an uploaded file from another page. Specifically, I have an HTML page with a <form action="upload.aspx"> and I can't figure out how to handle saving the file on the server in upload.aspx. I found a few examples (one being: http://msdn.microsoft.com/en-us/library/aa479405.aspx ) but that requires the <input type=file> element to be on the same page. I am having difficulties with grabbing the posted file on my upload.aspx page. Anyone have any pointers? How can I grab a posted file in aspx and save it to the server when the file is

How to take a photo and send to HTTP POST request with Android?

醉酒当歌 提交于 2019-11-27 09:07:09
I know this has answers here and there, but I couldn't make any of them work. Does anybody know a good reference, or a tutorial for this, maybe also post here? What I need to do is : 1) provide a button, that opens the camera application. I have done this by a startResultActivity() 2) user takes the photo, and returns to the application, with the photo saved, preferably with a preview in an ImageView. I tried something, but I cannot test in an emulated device. 3) presses a "send" button, and the application sends the picture to HTTP POST. With "multipart", whatever that is. The php developer

IIS 7.5, Web Service and HTTP 405 error

天大地大妈咪最大 提交于 2019-11-27 09:06:19
I have a web service which I host on my machine. I use Windows 7 and IIS 7.5. Problem : When the client tries to consume the web service, he/she gets a HTTP 405 error. In the log file of IIS, I can see that this is refused because POST verb is not allowed. Question : How can I allow POST verb for those requests? Do I have to add mapping of the WSDL file? And if I do, how do I have to configure this mapping? I have checked, and in existing mappings I have nothing for WSDL extension. Is there maybe another thing to setup on IIS to allow those requests? Web service is built using WCF . After

HttpPost works in Java project, not in Android

主宰稳场 提交于 2019-11-27 08:47:35
I've written some code for my Android device to login to a web site over https and parse some data out of the resulting pages. An HttpGet happens first to get some info needed for login, then an HttpPost to do the actual login process. The code below works great in a Java project within Eclipse which has the following Jar files on the build path: httpcore-4.1-beta2.jar , httpclient-4.1-alpha2.jar , httpmime-4.1-alpha2.jar , commons-logging-1.1.1.jar . public static MyBean gatherData(String username, String password) { MyBean myBean = new MyBean(); try { HttpResponse response = doHttpGet(URL

How to send files via HTTP_POST with Excel using VBA?

十年热恋 提交于 2019-11-27 08:29:56
The question asked here: How can I send an HTTP POST request to a server from Excel using VBA? is almost exactly what I was looking for except that I am trying to send a number of files to the server. I googled further and found How do I upload a zip file via HTTP post using VBA? This was also good, but pretty discouraging - it seems like a lot of work (not just making an HTML form here...). Option #2 here: http://www.motobit.com/tips/detpg_post-binary-data-url/ (as cited in the question on SO noted above) seems like it would work well, but as I work in JS and CSS, I have no idea how to create

Submit pdf form fields to a HTTP POST request

♀尐吖头ヾ 提交于 2019-11-27 08:07:58
I've made a pdf form in Adobe Acrobat. Now I want to make a button that submits the form to a HTTP POST request. I have searched for about 4 hours, but I have not found an example to do this. Here I read that it is possible to send the pdf form fields with a HTTP submission, but there's also no example given: http://acrobatusers.com/tutorials/form-submit-e-mail-demystified I'm looking for a JavaScript example that I can link to the submit button. doc.submitForm(url, false); or doc.submitForm( url, null, null, null, null, null, null, null, null, null null, null, null, null, null, "HTML" );