I would like to provide links to a website with the credentials already within the link. The link is:
https://mychart.covh.org/MyChart/
The credentials are:
Username = AllStarUser
Password = FiveStarPassword
I have tried
https://mychart.covh.org/MyChart/?Username=AllstarUser,Password=FiveStarPassword
and
http://mychart.covh.org/Mychart/logincheck.asp?login=AllStarUser&password=FiveStarPassword
but these don’t work. Any suggestions?
This is a POST form (method="post"). The form data has to be enclosed in the body of the HTTP request.
If it were a GET form (method="get"), you could enclose the form data in the URL, which is specified in the header of the HTTP request.
See also:
HTML 4.1: Form submission
HTML 5.2: Form submission
Stack Overflow: How are parameters sent in an HTTP POST request?
If this was a "get" -
https://mychart.covh.org/MyChart/logincheck.asp?Login=AllStarUser&Password=FiveStarPassword
would be correct.
Related
How Do I create a POST request with paw that is equal to a (jquery) ajax $.ajax({type: "POST", (...)});request?
I thought I could set the HTTP_X_REQUESTED_WITH to XMLHttpRequest but it does not work.
Whats the basic difference between an ajax/javascript POST and a regular POST from a form?
To simulate a POST request made via Ajax, what you need to do is to add an HTTP header:
X-Requested-With: XMLHttpRequest
Set the request method to POST
Enter the URL
Add the header mentioned above
Then enter the body in the Body tab, using the Form URL-Encoded mode:
When you are doing a post from a form, you are executing a submit event. In case you did not override the browser's default behavior for form submission at least for the case you are talking about, then the browser will execute it as an html post, which is a full postback. It sends the request and when the response arrives, it will be the new content of the page.
If you do a post with Javascript, then a request is sent and upon response, your callback will be executed, if existent.
How to get the previous URL in Rails? Not the URL that you got a request from, but the one before that?
Because I'm getting an AJAX request, and I need the URL for the page they are currently on (or the URL before the AJAX).
Try to use HTTP_REFERER.
In Rails: request.referrer or request.headers["HTTP_REFERER"]
Use
<%= url_for(:back) %>
# if request.env["HTTP_REFERER"] is set to "http://www.example.com"
# => http://www.example.com
here is more details.
In a web application there is no such thing as a previous url. The http protocol is stateless, so each request is independent of each other.
You could have the Javascript code, that sends a request back, send the current url with the request.
Just came across this question and it related to something simple I was doing presently.
A simple solution I have employed before when using ajax wizard style apps is to store two session variables which contain the previous and current request (with all params).
I just add these two lines to my application controller
session[:previous_request_url] = session[:current_request_url]
session[:current_request_url] = request.url
http://railscasts.com/episodes/246-ajax-history-state -> great for ajax
http://ethilien.net/archives/better-redirects-in-rails/ -> You could put in session as many previous url as you want.
I want to access some request parameters in an Orbeon form sent via post to this form. I tried to use the XPath expression xxf:get-request-parameter('task_id') within the form, but this only works when the parameter is attached to the url (e.g. orbeon/fr/Activiti/dokumentfreigabe/new?task_id=4711).
Since I do not want to send all parameters in the url (but via POST and SSL), I need a solution to access request parameters in an orbeon form sent as a POST-Parameter.
You can't access parameters sent to the form with a form POST with an XPath function. Could you use an HTTP header to pass this value, instead of a form POST? If it possible, then you could use xxf:get-request-header('your-header').
If the form POST is done by the browser, and not by another server-side app or filter or reverse proxy, then you obviously wouldn't be able to set the header directly from the browser. However, you could continue doing the form POST from the browser, and add a servlet filter that extracts the value, and sets the value of a header, so you can then read it with xxf:get-request-header('your-header').
I am developing an JSF 2.0 application for IBM Webshere 7.0 and I want to prevent user submitting a form using the GET method for security reason i.e user will not be able to submit a form appending the form values to the Query String.
Is there any simple solution for this or I need to build filter to prevent this ?
When you use JSF <h:form> it does a POST request be default. Even though a Query string is sent, since the submission method is POST, the result is not sent as a query string, that is, it is not added to the action URL of the form. Rather, the string is sent as the body of the HTTP request and the doPost() method of the FacesServlet will be invoked.
See also:
Proper way to call servlet from Facelets?
http://en.wikipedia.org/wiki/Query_string
I've got search form, which contains checkboxlist which is binded to my model. So when I set GET method to form I got long url:
(I even have exception:
The length of the query string for this request exceeds the configured maxQueryStringLength value.)
it's expecting, [0].IsSelected=false&[0].Id=6&[1].IsSelected=false...
But I would like url like this
www.domain.com/Action/Comma-separated-selected-idx
for example:
www.domain.com/Search/1,6,7
How can I fix,edit form get action? Thanks
I would do a POST instead, then redirect to the URL you desire.
OR
You could capture the form with some JavaScript and build the URL there.
agreed, POST or JS are your best options, I'd opt for a POST.