http-post

Android http post + web service PHP

无人久伴 提交于 2019-12-11 18:04:09
问题 I have a web service in PHP which returns a String, he recives two parametres, id and te. I've tested its using with the mozzila addon poster, so i decided to use it for my android app. This is my android code: final String query = null; AsyncHttpClient client = new AsyncHttpClient(); RequestParams rp = new RequestParams(); rp.put("id", num); rp.put("te", tab); Log.i("http","before send\n"); client.post("http://appdomain.hol.es/webService.php",rp, new JsonHttpResponseHandler(){ public void

Arduino WiFi shield failed to communicate with localhost server

时光怂恿深爱的人放手 提交于 2019-12-11 17:57:31
问题 I need to send data from Arduino through the WiFi shield to my localhost server and update my database and I'm stuck not knowing where or how has it gone wrong. My Arduino can connect to both the internet and to my localhost server via port 80. My server is set up using xampp and my .php file is located in the htdocs directory. I'm using HTTP POST on the server side, the code snippet for receiving the HTTP POST are as follow: $test_str = ""; if(isset($_POST["test_str"])){ echo "OK"; $test_str

jquery post returning rendered html page rather than sql result

痴心易碎 提交于 2019-12-11 17:52:53
问题 I am using codeigniter in my application and have a jquery post function that works perfectly. $.post('getticketstacktype', {ticketnumber:ticketnumber},function(result) { alert(result); } I am then using the exact same post function on another edit page. this page is prepopulated with PHP and works correctly. I use the same post to call my controller, I have checked that ticketnumber value is correct $.post('getticketstacktype', {ticketnumber:ticketnumber},function(result) { alert(result); }

jQuery ajax POST data is empty on the server for some clients

混江龙づ霸主 提交于 2019-12-11 17:50:58
问题 I encountered a very peculiar problem and none of the answers I found here solves it. On SOME clients (IE7, IE8) when I post the data using jQuery Ajax, such as: $.ajax({ type: 'POST', url: '<%= ResolveUrl"~/User.svc/GetUserListForCity") %>', data: '{"city":' + cityId + '}', contentType: 'application/json; charset=UTF-8', dataType: 'json', success: processList, error: showErrorAlert }); The error I am getting: "The OperationFormatter could not deserialize any information from the Message

How we can pass default null value in parameter list of dictionary [String:String] while posting a request to server ? Swift3

我的未来我决定 提交于 2019-12-11 17:49:52
问题 In some case i have to post null values to server either as a default value or as a parameter's value.I tried many ways but it didnt work.I'm using Alamofire for posting a request.Please help. Method-1 var empty : String = "" let parameters = ["User-Id":userId,"search_cat": formattedArray ?? empty,"date1":ab ?? empty,"date2" : bc ?? empty,"docname" : empty ] as! [String : String] Method-2 let parameters = ["User-Id":userId,"search_cat": formattedArray ?? "","date1":ab ?? "","date2" : bc ?? ""

MicroPython urequests.post failures

荒凉一梦 提交于 2019-12-11 16:57:59
问题 I'm trying to receive notifications on my (Android) mobile device from an ESP8266 MCU running MicroPython. For this reason I subscribed to a couple of online services exposing some APIs for this task, Pushbullet, and Pushed, and I installed the matching apps on my device. This is what I'm trying: Pushbullet: import json import urequests body = "Test Notification" title = "Pushbullet" data_sent = {"type": "note", "title": title, "body": body} API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx' pb_headers

How to I send POST parameters in this android studio code [duplicate]

我怕爱的太早我们不能终老 提交于 2019-12-11 16:48:52
问题 This question already has answers here : Sending POST data in Android (15 answers) Closed 2 years ago . I'm new to android and learning it now. I'm working on an application where I was able to get response form a get request successfully. Now I want to execute a POST request with a single parameter this is what I've came up with so far: public class BGTask extends AsyncTask<String, String, String > { @Override protected String doInBackground(String... params) { HttpURLConnection connection =

How to use async task for manipulating the httppost android

会有一股神秘感。 提交于 2019-12-11 15:39:35
问题 I am new to async task . I need to use httppost in my application. Please help me to manipulate the following code using async task. Please give me structured code HttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost("url here"); httpPost.addHeader("Content-Type", "application/xml"); try { HttpResponse response = httpClient.execute(httpPost); BufferedReader reader = new BufferedReader( new InputStreamReader(response.getEntity() .getContent(), "UTF-8"));

In the contoller, how do i obtain data from an http post? [duplicate]

╄→尐↘猪︶ㄣ 提交于 2019-12-11 14:50:46
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to obtain data from a form using method=“post”? How to request it data in my controller? I want to simply obtain data from a form.. Below is my form.. In my controller , how do i access the data from the form? <script type="text/javascript"> $(document).ready(function () { $("#SavePersonButton").click(function () { $("#addPerson").submit(); }); }); </script> <h2>Add Person</h2> <form id="addPerson" method=

How to send HTTP POST request to PHP service with Objective-C

試著忘記壹切 提交于 2019-12-11 14:27:05
问题 Im trying to post to php and get the response. The php file has an echo "hello" which should just print hello. I'm trying to test to see if posting is working but in my error log the NSlog doesn't display anything: @interface ViewController () @end @implementation ViewController @synthesize email, password,receivedData; -(IBAction)Login:(id)sender{ // Create the request. NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://grouporder.site90.net/test