http-post

Android : upload Image and JSON using MultiPartEntityBuilder

人盡茶涼 提交于 2019-11-28 07:40:58
I try to upload data to server, my data containing multiple images and large JSON , before it, I Try to send with convert image to string using base64 and send my another data and image that I've convert before with JSON , but I face Problem OutOfMemory here, so I read one of solutions that said I must to try using MultipartEntityBuilder . I still confusing and not understand how to do it with MultiPartEntityBuilder , Is there anyone can help me the way to do it with MultiPartEntityBuilder ? this is my code : try{ //membuat HttpClient //membuat HttpPost HttpPost httpPost= new HttpPost(url);

Getting IP address from HTTP POST request using Python

帅比萌擦擦* 提交于 2019-11-28 03:41:38
问题 I am using a python script to do my webserver using the BaseHTTPServer module. Below is my code for the server: import string,cgi,time from os import curdir, sep from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer #import pri class MyHandler(BaseHTTPRequestHandler): def do_GET(self): try: if self.path.endswith("/"): f = open(curdir + sep + "index.html") self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() self.wfile.write("<HTML> GET OK.<BR>") f

POST extra values in an HTML <form>

陌路散爱 提交于 2019-11-28 03:32:43
问题 I have a simple form which passes the value of an <input /> element: <form action="updaterow.php" method="POST"> <input type="text" name="price" /> </form> How can I post extra values along with the <input /> value? For example, an arbitrary string, or a variable inside the current PHP script. I know this is possible with GET: <form action="updaterow.php?foo=bar" method="GET"> <input type="text" name="price" /> </form> or: <form action="updaterow.php?foo=<?=htmlspecialchars($bar)?>" method=

how to yii getPost for array _POST vars?

烂漫一生 提交于 2019-11-28 02:36:42
问题 Assuming i have $_POST["x"]["y"] = 5; how can i Yii::app()->request->getPost('x[y]'); how can i retrieve the post variable by index ? and is there any yii function that checks for sql injection ? does the getPost do that check ? Thank you . 回答1: I am not familiar with yii, but looking at the source code for the function https://github.com/yiisoft/yii/blob/1.1.12/framework/web/CHttpRequest.php You would do $x = Yii::app()->request->getPost('x'); $y = $x['y']; The getPost function WILL NOT

http post with blackberry

爱⌒轻易说出口 提交于 2019-11-28 02:13:03
问题 I am trying to set up an http post in my Blackberry app. I have successfully implemented this in my corresponding Android app, so I know the server it working find. I have tried several different things, and I'm not really getting errors, its just the info on the server is not getting updated. I have looked at this post: Http POST in BlackBerry, and several others. I found them helpful, but they didn't ultimately solve my problem. Again, I don't get errors, but the server doesn't get updated.

how to send data from android to server

空扰寡人 提交于 2019-11-28 01:57:12
问题 I'm exploring to scan ssid and rssi from android and I'm able to do it, but now i have want send the data to the server, so i explore i found below code HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://101.34.45.45/rawData"); try { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(3); nameValuePairs.add(new BasicNameValuePair("userId", "00-22-68-E8-EC-F1")); nameValuePairs.add(new BasicNameValuePair("timestamp", "2010-07-01 11:11:11"));

Google Volley ignores POST-Parameter

扶醉桌前 提交于 2019-11-28 01:28:39
问题 I'm currently trying to send a simple POST-request via Google Volley to my server. Therefore I've written the following lines of code: Map<String, String> params = new HashMap<String, String>(); params.put("regId", "skdjasjdaljdlksajskl"); JSONObject object = new JSONObject(params); JsonObjectRequest request = new JsonObjectRequest(Method.POST, "address_of_my_server/method", object, successListener, errorListener); queue.add(request); But I get an Error 500 returned, which says, that there is

How to retrieve form “POST” data via cgi-bin program written in C

北城以北 提交于 2019-11-28 00:01:29
I am trying to retrieve POST data from html form using program written in C. At the moment I am using: char *formdata = getenv("QUERY_STRING"); if(formdata == NULL) /* no data retrieved */ This seems to be working fine with form "GET" method but not with "POST" method. How do I retrieve POST data? POST data is appended to the request header, after a double newline. In a CGI-BIN environment, you read it from STDIN. Be warned that the server IS NOT REQUIRED to send you an EOF character (or some termination indicator) at the end of the POST data. Never read more than CONTENT_LENGTH bytes. If I

Http post error: An existing connection was forcibly closed by the remote host

淺唱寂寞╮ 提交于 2019-11-27 23:56:59
问题 I realise there have been a number of similar posts to this but I haven't found a solution yet. Am trying to post some xml to an MPI gateway but keep getting the following error: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. Below is the code I'm currently using but have tried just about every different approach I can think of and they all return the same error: string result = ""; string xml = "<TNSAuthRequest><CardNumber

show “webpage has expired” on back button

夙愿已清 提交于 2019-11-27 23:42:16
问题 What is the requirement for the browser to show the ubiquitous "this page has expired" message when the user hits the back button? What are some user-friendly ways to prevent the user from using the back button in a webapp? 回答1: Well, by default whenever you're dealing with a form POST, and then the user hits back and then refresh then they'll see the message indicating that the browser is resubmitting data. But if the page is set to expire immediately then they won't even have to hit refresh