http-post

Multiple HTTP POST in sequence

这一生的挚爱 提交于 2020-01-04 04:12:21
问题 I have an app underdevelopment and I need to do 3 HTTP POSTs in sequence. What is the best way to implement this ? Should I Make each HTTP Post in it own Async Class and daisy chain the Async classes(i.e. call the second async from the onPostExecute of the first Async) Put all the HTTP POSTs in the doInBcakGround of a single Async. I know how to do a HTTP POST request and I am using the OKHTTP lib. I just would like to know that the best practice it for multiple POSTs in sequence. Cheers 回答1:

XMLHTTP request passing JSON string as raw post data

谁都会走 提交于 2020-01-03 15:56:58
问题 My JavasSript sends the request: var jax = new XMLHttpRequest(); jax.open("POST", "http://localhost/some.php", true); jax.setRequestHeader("Content-Type", "application/json"); jax.send(JSON.stringify(jsonObj)); jax.onreadystatechange = function() { if(jax.readyState === 4) { console.log(jax.responseText); } } Right now all my php does is: print_r($HTTP_RAW_POST_DATA); print_r($_POST); The output from the raw post data is the object string, but the post array is empty. {"name" : "somename",

Alternative to GET and POST methods to send/recieve data from a form

别说谁变了你拦得住时间么 提交于 2020-01-03 13:33:52
问题 I am trying to build a web application in PHP. But I dont want to use the GET & POST methods, as user shall know what and how are we sending the data, just by looking at the html end. Of course we can always sanitize the data, but still, I want to keep the format of data to myself. Is there an alternative to the above... can something be done with the url, so that the type and format of data is not revealed. I saw something in this regard that related to mod rewrite. Please suggest and tell

Alternative to GET and POST methods to send/recieve data from a form

大兔子大兔子 提交于 2020-01-03 13:31:47
问题 I am trying to build a web application in PHP. But I dont want to use the GET & POST methods, as user shall know what and how are we sending the data, just by looking at the html end. Of course we can always sanitize the data, but still, I want to keep the format of data to myself. Is there an alternative to the above... can something be done with the url, so that the type and format of data is not revealed. I saw something in this regard that related to mod rewrite. Please suggest and tell

C# Open web page in default browser with post data

风流意气都作罢 提交于 2020-01-03 10:55:27
问题 I am sure this must have been answered before but i cannot find a solution, so i figure i am likely misunderstanding other peoples solutions or trying to do something daft, but here we go. I am writing an add-in for outlook 2010 in C# where a user can click a button in the ribbon and submit the email contents to a web site. When they click the button the web site should open in the default browser, thus allowing them to review what has just been submitted and interact with it on the website.

ASIFormDataRequest doesn't send post values

时光总嘲笑我的痴心妄想 提交于 2020-01-03 06:18:29
问题 I try to send some values using ASIFormDataRequest. The problem is that even though the php script is executed no post data is received. Here is what I do: ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setPostValue:@"Ben" forKey:@"first_name"]; [request setPostValue:@"Copsey" forKey:@"last_name"]; [request startSynchronous]; In order to check what the server receives I have the following php test script: $handle = fopen("output.txt", "w"); fwrite($handle,

why are docx files corrupted by binary post, but .doc and .pdf are fine?

邮差的信 提交于 2020-01-03 05:19:21
问题 I'm posting files to an API in binary format. .pdf and .doc files are fine - they arrive in the system as expected and open up without any problems. But for some reason, .docx files show up as corrupt. Why would that be? Sub PostTheFile(CVFile, fullFilePath, PostToURL) strBoundary = "---------------------------9849436581144108930470211272" strRequestStart = "--" & strBoundary & vbCrlf &_ "Content-Disposition: attachment; name=""file""; filename=""" & CVFile & """" & vbcrlf & vbcrlf

Possible to upload file and parse the json result?

跟風遠走 提交于 2020-01-03 03:40:09
问题 I have a form that is used to upload the file and a CGI program in the server side to process the uploaded file. The file will be renamed to a different file name that I want to pass back to the client, I want to use JSON to return the result, but the browser always prompts me to save the returnd document to a file... Conclusion: I want to upload a file and from the HTTP response I want to parse it to get the new filename generated by server side. <form action="/a.bc?cmd=upload&user_name

MVC3 Razor httppost return complex objects child collections

牧云@^-^@ 提交于 2020-01-03 03:30:09
问题 I have not been using MVC3 for that long and think this is a flaw in my knowledge than a real issue. I have an object that has a few basic properties and then a collection of inner objects, (simplified version): public class myClass { public string Name { get; set; } public string Location { get; set; } public List<myOtherClass> Children { get; set; } } public class myOtherClass { public string Name { get; set; } public int Age { get; set; } } I have a view that is strongly typed to the

http post giving illegal state Exception

安稳与你 提交于 2020-01-03 02:41:16
问题 this is code which I use for HTTP post public void postData() { //DineOutActivity doa = null; HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("192.168.1.112/andro/index.php/androctrl/test/"); try { //food item Spinner spinner = (Spinner) findViewById(R.id.spinner1); String fooditem = spinner.getSelectedItem().toString(); TextView mDateDisplay = (TextView)findViewById(R.id.textView2); String Date = mDateDisplay.toString(); TextView mTimeDisplay = (TextView