http-post

Getting IP address from HTTP POST request using Python

不问归期 提交于 2019-11-29 10:31:22
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.close() return return except IOError: self.send_error(404,'File Not Found: %s' % self.path) def do_POST

How to HTTP POST a XML File using PHP without cURL? [duplicate]

假装没事ソ 提交于 2019-11-29 10:18:52
问题 This question already has answers here : How to post data in PHP using file_get_contents? (3 answers) Closed 6 years ago . I have a XML created from a Table In MySql, I need to make a HTTP Post to insert the XML into a Web Service. The Web Service just accepts SOAP, HTTP POST and HTTP GET methods. I tried to make the HTTP POST request in different ways with no luck at all. I never worked with SOAP before. How can I make the HTTP POST or SOAP Request? post_xml.xml: <?xml version="1.0" encoding

how to yii getPost for array _POST vars?

痞子三分冷 提交于 2019-11-29 09:13:21
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 . 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 prevent sql injection. Please read http://www.yiiframework.com/wiki/275/how-to-write-secure-yii-applications/

Android: Http post with parameters not working

偶尔善良 提交于 2019-11-29 09:00:47
问题 I need to create an HTTP POST request with parameters. I know there are many examples out there, I have tried using HTTPparams, NameValuePair etc but cant seem to get the correct format for the server. Server Type: REST based API utilizing JSON for data transfer Content-type: application/json Accept: application/json Content-length: 47 {"username":"abcd","password":"1234"} I can pass these headers but I cant seem to pass these params "username","password". Here is my code: HttpClient client =

Sending json object via http post method in android

﹥>﹥吖頭↗ 提交于 2019-11-29 08:57:27
its NOT DUPLICATE.Link that has been provided is an OLD one."http client" has been removed in api23 I want to send json object: {"emailId":"ashish.bhatt@mobimedia.in","address":"Naya bans","city":"Noida","pincode":"201301","account_number":"91123546374208","bank_name":"Axis Bank","branch_name":"91123546374208","ifsc_code":"UTI0000879"} to url: http://10digimr.mobimedia.in/api/mobile_retailer/update_profile How do i do it? via post method? METHOD: POST /api/mobile_retailer/update_profile MANDATORY KEY: {"emailId","address"} REQUEST JSON: {"emailId":"ashish.bhatt@mobimedia.in","address":"Naya

http post with blackberry

荒凉一梦 提交于 2019-11-29 08:51:41
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. Here is the code I am currently using: String url = "http://xxxx.com/ratings/add?;deviceside=true";

Async HTTP post android

99封情书 提交于 2019-11-29 08:44:29
I am using an application where i just need to download a pair of coordinates for google maps from a mysql server. I can do this successfully using php and a normal httpost but my app freezes for a few seconds when i do it. I read that you need to make httppost asycronous in order to avoid that freezing until the server finishes the prossess and sends the results. The point is that i need that results in a json array like the normal httpost. For example if i had this httppost. HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.yoursite.com/script.php"

how to send data from android to server

喜欢而已 提交于 2019-11-29 08:24:27
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")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient

How to post a photo. iOS Facebook SDK 3.1

无人久伴 提交于 2019-11-29 08:20:35
问题 I needed to publish a picture on my wall. The pic is generated in my iPad app. 回答1: This is the simplest way I've found - (void) postImageToFB:(UIImage*)image { NSData* imageData = UIImageJPEGRepresentation(image, 90); NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"This is my drawing!", @"message", imageData, @"source", nil]; [FBRequestConnection startWithGraphPath:@"me/photos" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection

Google Volley ignores POST-Parameter

回眸只為那壹抹淺笑 提交于 2019-11-29 07:59:31
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 a missing parameter (regId). I've tried the same with a GET-Request, but I got the same result. Only