http-post

Upload multiple files using http POST

 ̄綄美尐妖づ 提交于 2019-12-09 18:10:54
问题 I am having a problem uploading files with FTP from my iPhone app. I am sending an HTTP POST request to my webservice with all the necessary parameters. I am sending two files, one is an image, and the second is audio. The image is being uploaded, but the audio isn't. When I trace my web service it only shows the image field as an uploaded file. It's not showing that the audio is also there. My code is: NSString *urlString = [NSString stringWithFormat:ADD_LEAD_API_URL]; NSMutableURLRequest

Parsing a XML HttpResponse

五迷三道 提交于 2019-12-09 15:58:43
问题 I'm trying to parse the XML HttpResponse i get from a HttpPost to a server (last.fm), for a last.fm android app. If i simply parse it to string i can see it being a normal xml string, with all the desired information. But i just cant parse the single NameValuePairs. This is my HttpResponse object: HttpResponse response = client.execute(post); HttpEntity r_entity = response.getEntity(); I tried two different things and non of them worked. First i tried to retrieve the NameValuePairs: List

Getting form data from HttpListenerRequest

左心房为你撑大大i 提交于 2019-12-09 14:47:09
问题 I have a HttpListenerRequest which was initiated from a html <form> that was posted. I need to know how to get the posted form values + the uploaded files. Does anyone know of an example to save me the time doing it for myself? I've had a google around but not found anything of use. 回答1: The main thing to understand is that HttpListener is a low level tool to work with http requests. All post data is in HttpListenerRequest.InputStream stream. Suppose we have a form like that: <form method=\

Can't POST large html5 canvas to server?

怎甘沉沦 提交于 2019-12-09 09:41:21
问题 I have a canvas that you can paint on. I need to save it's contents to the server so it can be resumed later. To do this, I xMLHttpReq.send(*) the encodeURIComponent(canvasP.toDataURL())* via a xMLHttpReq.open("POST", url, false); In my php script, I take the $_POST and base64_decode(json_decode($_POST[data])) and I save it to a .png file on the server. NOW, this works fine and dandy if the canvas has a small doodle on it. BUT if the 1600x1200px canvas has a lot of stuff drawn on it, and it's

HttpURLConnection doing a get request even after setDoOutput(true), setRequestMethod(“POST”) setRequestProperty(\"Content

北城以北 提交于 2019-12-09 07:45:32
Here is the code: String Surl = "http://mysite.com/somefile"; String charset = "UTF-8"; query = String.format("param1=%s&param2=%s", URLEncoder.encode("param1", charset), URLEncoder.encode("param2", charset)); HttpURLConnection urlConnection = (HttpURLConnection) new URL(Surl + "?" + query).openConnection(); urlConnection.setRequestMethod("POST"); urlConnection.setDoOutput(true); urlConnection.setUseCaches(false); urlConnection.setAllowUserInteraction(false); urlConnection.setRequestProperty("Accept-Charset", charset); urlConnection.setRequestProperty("User-Agent","<em>Android</em>");

Fiddler not capturing HTTP requests from Java Application

别等时光非礼了梦想. 提交于 2019-12-09 07:43:26
问题 I am currently writing a java application that uses HTTP POST to upload a csv file and a few other parameters to a server. The server keeps returning 500 errors to my application and I would like to view the HTTP request in Fiddler so I can see the POST request. When I run Fiddler it will not capture any HTTP traffic from the Java application. I have written a GET request that works, so I know I can communicate with the server, however no traffic is shown through Fiddler. 回答1: You can simply

How do I add basic authentication to a Python REST request?

淺唱寂寞╮ 提交于 2019-12-09 06:28:12
问题 I have the following simple Python code that makes a simple post request to a REST service - params= { "param1" : param1, "param2" : param2, "param3" : param3 } xmlResults = urllib.urlopen(MY_APP_PATH, urllib.urlencode(params)).read() results = MyResponseParser.parse(xmlResults) The problem is that the url used to call the REST service will now require basic authentication (username and password). How can I incorporate a username and password / basic authentication into this code, as simply

HttpHostConnectException: Connection refused Android

被刻印的时光 ゝ 提交于 2019-12-09 06:12:45
问题 I am trying to connect via HttpPost and send a username and password to a website and then receive a string from that website. I have tried various methods that have worked for me in the past but now when I send the username and password identifiers the app times out for as long as 4 minutes and then spits out the following exception: 07-16 16:32:32.897: W/System.err(632): Unable to connect to the server 07-16 16:32:32.907: W/System.err(632): org.apache.http.conn.HttpHostConnectException:

S3 - Anonymous Upload - Key prefix

别来无恙 提交于 2019-12-09 04:20:23
问题 I am trying to understand exactly how to setup a bucket that is generally private but allows anonymous uploads with restrictions. The specific criteria are: The bucket is mostly private and requires my key/secret to add/remove/update/list files. There is a "directory" (i.e. key prefix) called "incoming" that will allow anonymous users to upload content to but not list. The bucket has a one day expiration on all content. As a bonus I would like the "incoming" directory to have a 30 minute

Angular2 http post not passing the json object to MVC 6 controller action

久未见 提交于 2019-12-09 01:09:21
I am working on an angular 2 application using asp.net MVC6. Angular2 Http post method calls the controller action and works properly when there is no parameter/properties, but when i add a parameter to the controller action, The expected JSON mapping is not happening while trying to call action with the parameter values. Debugging the action shows null value to the parameter. I tested with all the solutions provided in this discussion , but still i am getting the null value for the parameter. debug screenshot Here is my code 1.Controller action [HttpPost] public IActionResult addNewUser