http-post

Login to a site and then POST to a page in it

自作多情 提交于 2019-12-04 16:57:21
I have to login to a page using three parameters, after that I have to POST two parameters to another page inside the site I've just logged in. So far I've got a cookie with this: curl -c cookie.txt -d "username=username&pwd=pwd&domain=mydomain" http://myurl ...inside of the cookie I have a JSESSION id. I use the cookie as follows: curl -b cookie.txt -d "par=value" http://myurlnumbertwo Problems: even after a POST to the login url I get in the console the HTML code of the login page, does this mean that the login did not succeed? How can I find the error that caused this, maybe a log? after a

android: displaying progress dialog when waiting for connection

安稳与你 提交于 2019-12-04 16:51:16
I am trying to add a progress dialog when a new activity is launched that has to wait for a response from the internet. At the moment the screen just goes black while it is waiting. Does any one know where it needs to be placed to work? this progressDialog: ProgressDialog dialog = ProgressDialog.show(SearchActivity.this, "", "Loading. Please wait...", true); dialog.dismiss(); this is in the overlayActivity extends ItemizedOverlay: @Override protected boolean onTap(int index) { final OverlayItem item = (OverlayItem) items.get(index); final Context mContext = context; AlertDialog.Builder builder

How to send data in the HTTP request body when using an HTML form?

这一生的挚爱 提交于 2019-12-04 15:59:08
问题 The HTTP spec says that a POST request can contain an arbitrary body of data. An HTML form element can POST to a URL and may contain input elements, but those input elements get turned into a query string. How can I get a form to also send along data in the body of the HTTP POST request that it sends when its submit button is pressed? 回答1: The HTTP spec says that a POST request can contain an arbitrary body of data. That's correct. There are in turn however several specifications of the

How to parse json of an incoming POST request in Rails?

耗尽温柔 提交于 2019-12-04 15:48:18
问题 I have the following problem. A web service is sending a JSON POST request to my app and I want to parse it. I thought I just can access the params with @var = params[:name_of_the_JSON_fields] but it doesn't work. I see in my Heroku logs, that the request is done and that the parameters are there, but I just can't store them. Does anyone have an idea? 回答1: When you post JSON (or XML), rails will handle all of the parsing for you, but you need to include the correct headers. Have your app

How to set a timer using jQuery to sent HTTP post data of HTML form

China☆狼群 提交于 2019-12-04 15:44:40
I have an HTML form that I need to post to the server with HTTP POST and input data. Specifically, I need to send only the parameter values of all the checkboxes that are checked in the form. I need to do it if the user doesn't do it himself in 10 minutes. I am not sure the best way to achieve this but for now I am trying to use jQuery do that but sadly I don't know anything about JavaScipt or jQuery so I am trying to learn it but failing to achieve something as simple as that. I need to the run the following after 10 minutes since the page on which the form is loads. $("document").ready

Play framework 2.0 Form.bindFromRequest().get() returns empty model

时光毁灭记忆、已成空白 提交于 2019-12-04 15:40:27
I need to receive same POST data from a socket communication. This is the code that send the POST and receive the response, and seems to work correctly: String data = "t=" + URLEncoder.encode("Title", "UTF-8") + "&u=" + URLEncoder.encode("http://www.myurl.com", "UTF-8"); URL url = new URL("http://localhost:9000/adserver"); URLConnection conn = url.openConnection(); conn.setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); wr.write(data); wr.flush(); BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); String output = "Data

Logging in via HttpPost to a website via an application

自闭症网瘾萝莉.ら 提交于 2019-12-04 15:35:35
Hello Stackoverflowers! I have written a relatively simple application that consists of a login text field, a password text field and a login button. My goal is that when the user enters the login information and touches the login button, the application will log the user into the website I have specified and open it up in a different intent or WebView. My current implementation opens a new activity with a WebView and passes in the login information. My code is as follows for the new activity: setContentView(R.layout.web); try { //add the users login information(username/pw) to a List List

How to make OKHTTP post request without a request body?

梦想与她 提交于 2019-12-04 15:18:43
问题 Possible way to make OkHTTP post request without a request body in okhttp library ? 回答1: RequestBody reqbody = RequestBody.create(null, new byte[0]); Request.Builder formBody = new Request.Builder().url(url).method("POST",reqbody).header("Content-Length", "0"); clientOk.newCall(formBody.build()).enqueue(OkHttpCallBack()); 回答2: This worked for me: RequestBody body = RequestBody.create(null, new byte[]{}); 回答3: "".toRequestBody() "".toRequestBody("application/json".toMediaTypeOrNull()) ..

Sending a HTTP Post from magento 1.6 after customer registration?

折月煮酒 提交于 2019-12-04 15:03:39
can anyone point me in the right direction I need to send a HTTP post when a customer registers and or makes a purchase from Magento to a third part server ? It will be the basic information like name, address, postcode , email ect. Not sure where to start ? Many thanks $client = new Varien_Http_Client('http://www.example.com/'); $client->setMethod(Varien_Http_Client::POST); $client->setParameterPost('name', $name); $client->setParameterPost('address', $address); //more parameters try{ $response = $client->request(); if ($response->isSuccessful()) { echo $response->getBody(); } } catch

$_POST not working. “Notice: Undefined index: username…” [duplicate]

可紊 提交于 2019-12-04 14:51:56
Possible Duplicate: PHP: “Notice: Undefined variable” and “Notice: Undefined index” So, I am currently learning PHP and was reading on a book about the md5 function for passwords, so I decided to give it a try and see how it goes. I also decided to use the POST method rather than the GET, since I saw people saying that it is safer and doesn't let the variables appearing on the URL. For my testing project I made a very simple form, which follows: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <form action="dologin