http-post

how to make httpPost call with json encoded body?

橙三吉。 提交于 2019-11-27 14:46:51
i am using following code to make an httpPost call but it is returning me 400 bad request when i try to give following parameters in "simple rest client" in chrome extension it works fine any one guide me what mistake am i doing here? Simple rest Client I entered the following: URL: http://jon2012.com/api/register Method: POST Headers: No headers, as they are not required Data: { "email": "test@example.com", "first_name":"Name" } Android Code: HttpClient client = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); //Timeout Limit HttpResponse response

Are there Firefox extension (or any other browser) that allow to send arbitrary POST data to a webpage? [closed]

房东的猫 提交于 2019-11-27 14:29:06
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I want to test the security of a website of mine and I would love to have an application that is able to send POST data, if it's even

Open new window by POST using h:commandButton

旧时模样 提交于 2019-11-27 14:26:46
I need to open a JSF page in a new window by POST on click of a <h:commandButton> . I know I can acheive this using the JavaScript. But I would like to achive this using JSF and not JavaScript. How can I achieve this? I'm using JSF 2.0. The only non-JS way is to set target="_blank" in the parent <h:form> . <h:form target="_blank"> ... <h:commandButton value="Open in new Window" /> </h:form> This however affects all non-ajax(!) actions which are performed in the very same form. So if you're smart, make the action which shouldn't open in a new window an ajax action. However, ajax is also

post request using python to asp.net page

一个人想着一个人 提交于 2019-11-27 14:09:47
i want scrap the PINCODEs from " http://www.indiapost.gov.in/pin/ ", i am doing with following code written. import urllib import urllib2 headers = { 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Origin': 'http://www.indiapost.gov.in', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17', 'Content-Type': 'application/x-www-form-urlencoded', 'Referer': 'http://www.indiapost.gov.in/pin/', 'Accept-Encoding': 'gzip,deflate,sdch', 'Accept-Language': 'en-US,en;q=0.8', 'Accept-Charset': 'ISO-8859-1,utf-8;q

Android: Sending a byte[] array via Http POST

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 14:07:37
I am able to do a POST of a parameters string. I use the following code: String parameters = "firstname=john&lastname=doe"; URL url = new URL("http://www.mywebsite.com"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRequestProperty("Content-Type","application/x-www-form-urlencoded"); connection.setRequestMethod("POST"); OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream()); out.write(parameters); out.flush(); out.close(); connection.disconnect(); However, I need to do a POST of binary data (which is

How to send a POST request with JSON body using Volley?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 13:45:07
How to pass these parameter into POST method using Volley library. API link: http://api.wego.com/flights/api/k/2/searches?api_key=12345&ts_code=123 Screenshot of JSON structure I tried this but again facing error. StringEntity params= new StringEntity ("{\"trip\":\"[\"{\"departure_code\":\"," +departure,"arrival_code\":\"+"+arrival+","+"outbound_date\":\"," +outbound,"inbound_date\":\","+inbound+"}\"]\"}"); request.addHeader("content-type", "application/json"); request.addHeader("Accept","application/json"); Please visit here for the details of API. Usual way is to use a HashMap with Key-value

What are the advantages of using a GET request over a POST request?

纵然是瞬间 提交于 2019-11-27 13:30:17
Several of my ajax applications in the past have used GET request but now I'm starting to use POST request instead. POST requests seem to be slightly more secure and definitely more url friendly/pretty. Thus, i'm wondering if there is any reason why I should use GET request at all. I generally set up the question as thus: Does anything important change after the request? (Logging and the like notwithstanding). If it does, it should be a POST request, if it doesn't, it should be a GET request. I'm glad that you call POST requests "slightly" more secure, because that's pretty much what they are;

On Android, make a POST request with URL Encoded Form data without using UrlEncodedFormEntity

怎甘沉沦 提交于 2019-11-27 12:53:46
I have a string that is already in the proper URLEncoded Form format and would like to send it through a POST request on Android to a PHP server. I know the method for sending URL encoded forms on Android uses the UrlEncodedFormEntity and I know how to use it . The problem with that is that the data comes into the function already URL encoded and joined by ampersands, so using UrlEncodedFormEntity would involve a lot of extra work to turn it into a List of NameValuePairs and I'd rather not. So, how do I make a proper POST request sending this string as the content body? I have already tried

Android- POST multipart form data

旧街凉风 提交于 2019-11-27 11:50:45
I would like to send multipart form with video and data such as Email and name. The following is my code and it does not work ,there is no response from the server File file =new File(VideoPath); HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(url); try { // Add your data List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("Name", "LDGHT")); nameValuePairs.add(new BasicNameValuePair("Email", "hhh@example.com")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); httppost.setEntity(new

What 'sensitive information' could be disclosed when setting JsonRequestBehavior to AllowGet

馋奶兔 提交于 2019-11-27 11:30:56
I've been getting the same old error every time I test a new URL from my browser's address bar when I'm returning Json (using the built-in MVC JsonResult helper ): This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request . To allow GET requests , set JsonRequestBehavior to AllowGet . Rather than grunt in acknowledgement and fire up Fiddler to do a post request, this time, I'm wondering exactly what it is that a GET request exposes that a POST request doesn't? SilverlightFox Say your website has a GetUser web