http-post

Sending a file with HttpPost?

允我心安 提交于 2020-01-06 14:47:47
问题 I'm trying send an image to web service using HttpPost. The problem is when I try send image return an error that image does not found, but image exist I selected that in gallery. How can I solve this ? Here how I'm trying public Boolean insert(Usuario u, String fotoPath){ HttpClient httpClient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(urlPost.toString()); try { File img = new File(fotoPath, ConvertStringToMD5.getMD5(u.getEmail().split("@")[0])); httppost.addHeader(

Sending a file with HttpPost?

…衆ロ難τιáo~ 提交于 2020-01-06 14:47:27
问题 I'm trying send an image to web service using HttpPost. The problem is when I try send image return an error that image does not found, but image exist I selected that in gallery. How can I solve this ? Here how I'm trying public Boolean insert(Usuario u, String fotoPath){ HttpClient httpClient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(urlPost.toString()); try { File img = new File(fotoPath, ConvertStringToMD5.getMD5(u.getEmail().split("@")[0])); httppost.addHeader(

Unable to do a HTTP POST to a REST service passing json through C#

半城伤御伤魂 提交于 2020-01-06 12:47:30
问题 I am trying to invoke(HTTP POST request) a REST web service from C# code passing json input. Below is the code i am using. MyModel myModelObj = new MyModel(); myModelObj.code = "0003"; myModelObj.qty = "3"; var serializer = new JavaScriptSerializer(); var jsonInput = serializer.Serialize(myModelObj); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); Byte[] byteArray = encoding.GetBytes(jsonInput); request

Android httppost network violation

点点圈 提交于 2020-01-06 07:53:54
问题 I have a problem with my android app. I mean I'm using the code from one of tuts in the internet, looks like below public static String sendLocation(String s) { // Create a new HttpClient and Post Header //HttpParams params = new BasicHttpParams(); //params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://google.com/read.php"); //String d = "ok"; try { // Add your data List

“JSONValue failed” Error while fetching data from server into iPhone

℡╲_俬逩灬. 提交于 2020-01-06 03:33:06
问题 I am fetching data from server into my iPhone app. For fetching data from server, I am using HTTP Post method and for parsing data obtained I am using SBJSON Parser. When the first time my app launches, the data is not fetched. It shows the following failure log in Console. The app does not crash but just that data is not fetched. <html>Your request timed out. Please retry the request. </html> 2011-04-21 08:39:06.339 Hive[1594:207] -JSONValue failed. Error trace is: ( "Error Domain=org

Problems making http-post requests with German umlauts (ä ö ü) or special chars (ß) with Node.js

若如初见. 提交于 2020-01-06 02:52:06
问题 TLDR; solved, see comments below :) I am really getting nuts with this: I want to post JSON to the Redmine API to send time entries imported via CSV files. Everything works well, until I try to send strings with German umlauts (ä ü ö) or special chars (ß). I am using the request package with the following code: var options = { url: self.getHost() + path, headers: { 'Content-Type': 'application/json; charset=utf-8' }, method: method }; options.headers[self.getApiKeyHeader()] = self.getApiKey()

Google Plus API Count Call Failing

微笑、不失礼 提交于 2020-01-05 13:10:50
问题 I've created an POST request to pull the share count for a specific URL from Google Plus but have been unable to get any count value returned. Am I going the long way about it or is there an easier way to retrieve this data, for example Facebook and Twitter supply a URL that you pass the URL to that you want to retrieve the share count for and it returns a result in a JSON format!? GOOGLE_API_KEY id a defined variable of the key I've gotten from Google's developer console for Google+ API .

Google Plus API Count Call Failing

↘锁芯ラ 提交于 2020-01-05 13:10:43
问题 I've created an POST request to pull the share count for a specific URL from Google Plus but have been unable to get any count value returned. Am I going the long way about it or is there an easier way to retrieve this data, for example Facebook and Twitter supply a URL that you pass the URL to that you want to retrieve the share count for and it returns a result in a JSON format!? GOOGLE_API_KEY id a defined variable of the key I've gotten from Google's developer console for Google+ API .

Xamarin Forms - Cannot set the ContentLenght of HttpWebRequest

强颜欢笑 提交于 2020-01-05 07:22:29
问题 I tried to mke a request with GET and parameters. However, I got an exception for the WinPhone8.1 which meaned that GET was a violation protocol due to a content added in. So making a POST request is the solution. Despite my searches, I'm still not able to set the content lenght property of my HttpWebRequest.. Why? private static async void AsyncRequest(string url, string contentType, string methodType, int contentLenght, Action<Object, string> callback, Action<HttpStatusCode, JObject, Action

Xamarin Forms - Cannot set the ContentLenght of HttpWebRequest

别等时光非礼了梦想. 提交于 2020-01-05 07:21:09
问题 I tried to mke a request with GET and parameters. However, I got an exception for the WinPhone8.1 which meaned that GET was a violation protocol due to a content added in. So making a POST request is the solution. Despite my searches, I'm still not able to set the content lenght property of my HttpWebRequest.. Why? private static async void AsyncRequest(string url, string contentType, string methodType, int contentLenght, Action<Object, string> callback, Action<HttpStatusCode, JObject, Action