http-post

Jsoup HTTP POST with payload

亡梦爱人 提交于 2019-12-14 01:13:53
问题 I am trying to make this http request via Jsoup: http://api.decarta.com/v1/[KEY]/batch?requestType=geocode as given here. And here is my code for the same: String postUrl=postURLPrefix+apiKey+"/batch?requestType=geocode"; System.out.println(postUrl); String response= Jsoup.connect(postUrl).timeout(60000).ignoreContentType(true) .header("Content-Type", "application/json;charset=UTF-8") .method(Connection.Method.POST) .data("payload",jsonPayload.toString()) .execute() .body(); The jsonPayload

Android - Sending Image file to the Server DB with POST Request [duplicate]

前提是你 提交于 2019-12-13 22:48:13
问题 This question already has answers here : Android - Send Image file to the Server DB (4 answers) Closed 6 years ago . I'am working on client-server communication on my app. I need to send name of the product, description and photo of the product. Users can save the data and after that those data will save on the wishlist. And I want to send these data to the Server DB. I succeeded to send text data which are name and description to the server, but i don't really know how to send image file.

Retrofit SocketTimeoutException - Uploading Image

蹲街弑〆低调 提交于 2019-12-13 17:54:07
问题 I'm currently using Retrofit for Android as my network communications. When POSTing to my backend server an image, the server is in the middle of the upload and then retrofit "times out" with SocketTimeoutException. I have added the OKhttp library as some have suggested and still getting the timeout. The current img sizes are around 750kb because I have scaled them down. Is there an appropriate way to changes the amount of time until a timeout for retrofit? Or is there a better way to upload

WCF REST 4.0 PUT/POST/DELETE not working (400 Bad Request)

血红的双手。 提交于 2019-12-13 16:00:36
问题 I have been working on setting up a WCF REST service in .NET 4.0. I have GET requests working, but any request that involves POSTing data to the server fails with a HTTP 400 Bad Request . This is my simple service: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class Service1 { [WebGet(UriTemplate = "")] public string HelloWorld() { return "hello

jQuery AJAX POST object to ASP.Net WebMethod having dynamic datattypes

独自空忆成欢 提交于 2019-12-13 15:41:01
问题 Hi, Anyone have an idea what I am doing wrong here. I'm trying to POST JSON objects to ASP.Net WebMethod using jQuery AJAX. Although I'm getting the objects on server side but not the way I wanted. I wanted customer object to be a simple object so I can access like normal instances e.g. customer.Name, but I can't because it's getting there as dictionary object. EDIT:: Why JSON is getting on server side as Dictionary object for c# dynamic type? Here's the quick watch screen-cast; Here's

C# Web API POST parameter FromBody is always null

被刻印的时光 ゝ 提交于 2019-12-13 14:31:47
问题 I've been scouring the web for hours and tried many different solutions also described here on StackOverflow. I know similar questions have been asked before, but none of the answers or comments have worked for me. The problem: I have a .NET Web API that has a Post-method with some parameters. One of the parameters is a complex object that is supposed to be read from the body (that is JSON). However, this object is always null . This is my code: // POST api/worksheets/post_event/true/false

Making Post request with XML data in Angular 5

主宰稳场 提交于 2019-12-13 13:53:17
问题 I'm am new to angular and using angular 5. I'm making a http post request and I want to send xml data to backend as my backend only accept data in xml format. I've followed some tutorials but couldn't get it to work. Please let me know what I'm doing wrong and how can I make it work. This is how I'm making request. signin(){ const headers = new HttpHeaders({responseType: 'text' , 'Content-Type': 'text/xml' }).set('Accept', 'text/xml'); let body = '<request>' '<username>Username</username>' '

Slow HttpPost request on Android

杀马特。学长 韩版系。学妹 提交于 2019-12-13 13:26:51
问题 I'm making an app a part of which involves downloading data from my server in JSON format. I'm using HTTP Post to achieve the same. The JSON file I'm downloading is around 2-3 Kb in size. I'm doing all these operations on a different thread. However, the performance of my app is very unpredictable. I tried debugging it and found that sometimes my app gets stuck at line where I'm creating HttpPost object and sometimes it hardly takes 1-2 seconds to execute that line. What can be the issue ?

how to get a httppostedfile from a ASP.NET Web API (POST or PUT) call?

我与影子孤独终老i 提交于 2019-12-13 13:14:48
问题 Actually my question is short. How can I get a HttpPostedFile from a ASP.NET Web API POST or PUT? I did see that I can get various information from the Request like Request.Header, Request.Content, Request.Properties. Where in there can I find the file I passed and how can I create a HttpPostedFile from it? Thanks in advance! 回答1: Your short question does not have a short answer I am afraid. ASP.NET Web API exposes you to the wonders of HTTP while ASP.NET MVC abstracted some of it - in this

HTML form submit button does not write in $_POST

佐手、 提交于 2019-12-13 09:23:42
问题 I want a form with 4 submit buttons. Once any of them is pressed, they shell call the same page with different content. To determine which content it is, I will write a PHP Script, but I have not come that far yet. My Problem on the way is, that I need to pass the value along. I found an answer to my question in here ( Two submit buttons in one form ). I copied and adjusted the code but it is not working. When I want to access the $_POST array with my defined name, it says it is an unknown