Is It possible to get swagger request body in php, javascript, ruby, etc in response of swagger instead of only getting curl response template.
Related
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.
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.
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 struggling with Jquery ajax. In documentation of Jquery, I notice that they have mentioned to pass data from json format.
However, when I pass it data as normal html format, I could get the response.
I am worried why then json?
When I try with json,
I get issues with json . When I have to pass lot of html contents such as tables , div and etc,.
I get extra \ characters in the response.
It's not necessary to pass only JSON. You can send and pull almost anything over AJAX. I think your problem is that you're not setting the dataType in your $.ajax function call.
In all likelihood, this question reveals my gross misunderstandings of Rails, HTTP, and the internet.
Problem
I have a request hitting my server from a "transparent redirect" via Stripe API. The request is coming in as HTML format. I want to respond to it in JS format in an AJAX-esque way. My code looks like this:
def create
.... other code ....
render "attendances/create", formats: [:js]
end
I have a view file "attendances/create.js.erb." This successfully sends a response, but rather than the response executing the JS, the JS is instead rendered as HTML. It thus looks like plaintext JS.
Thank you for taking the time to consider this!
What are the request headers, Your ajax request must have accept request headers of javascript instead of default html, for it to allow/execute the js response directly.
See datatype here , it should be script