IIS - Accept a HTTP GET, then wait, trigger POST to API, wait for POST 200 OK reply with REDIRECT to original HTTP GET - http

I'd like to know if how I might achieve the following in IIS.
User clicks button in email with HTTP GET link.
Request is sent to IIS
IIS sends POST to MS Flow HTTP endpoint to trigger flow.
Flow finishes and sends back 200 OK
Original HTTP GET receives reply with REDIRECT to different URL (HTTP GET)
Essentially I need the first HTTP GET to tigger my flow, wait for it to complete then redirect the user to another webpage if successful.
Thanks !

Related

jmeter -not adding authorization header to all http requests

i have a fairly simple testplan with following steps recorded
Thread Group
Recording Controller
HTTP Authorization manager
GET https://xxxx/user/login
GET https://xxxx/accounts/list
GET https://xxxx/user/settings
GET https://xxxx/partners/list
GET https://xxxx/user/logout
When i run this, i see jmeter adding the authorization header in the first user/login request and server responds with 200 OK. This is OK
i extract the session token from the login response and put it as a variable into the subsequent http requests.
jmeter is not adding the authorization header in the subsequent accounts/list request - this is OK
but then jmeter is adding the authorization header into the subsequent user/settings request - this is not needed as it defeats the purpose of sending the session token.
Again jmeter is not sending the auth token in partners/list but is sending it again in user/logout request.
So question is how jmeter determines when to add the auth header and when not?
The desired behaviour i want is for jmeter to send the auth header in the first user/login request but not in any of the subsequent http requests.
Any pointers appreciated.
thanks
HTTP Authorization Manager will add Authorization header to all the HTTP Request samplers it its scope, if you place it at the same level with the HTTP Request samplers - it will add the header to all of them.
If you need to apply the HTTP Authorization Manager to 1st sampler only - move it to be the child of the first sampler.
More information: JMeter Scoping Rules - The Ultimate Guide
Recording any scenario adds up the Header Manager in all the Http requests.
You are doing it in correct way, however still you have to make few changes in your scripts to run seamlessly.
Delete all the subsequent Header Manager under the accounts/list,user/settings,partners/list & logout.
Post the Login Request > extract the session > Add a Header Manager after Login request and pass the session there.
All the further request should be in the same thread so that the session get passed to each request.
Also while recording there are multiple requests that gets captured and for each scenario Jmeter maintains the session under Header Manager, hence this should never be the case that one request is getting the session while others not.
Thanks for the answer that helps.
What i did and worked well in the mean time is add an explicit authorization header to the user/login request with a beanshell preprocessor to base64 encode the username / password.
thanks anyways

If return response HTTP 204, What a correct header connection value?

If application will return response HTTP 204 .
What a correct header connection value (close or keep-alive)?
204 means there is no body to send back. You would still typically keep the connection open for subsequent requests so don’t have to close it this point.
Think of this scenario:
A web page has a “contact us” form which makes an XHR call rather than a POST. In that case you might send back a 204 to say the XHR call was successfully logged but you can keep the connection open so user can still browse the rest of the site without having to reestablish the connection.
If however your endpoint is for API calls only and no further requests will me made sending connection: close may make sense to save server resources.
The 204 (No Content) status code indicates that the server has
successfully fulfilled the request and that there is no additional
content to send in the response payload body.
So according to my understanding, as the server doesn't have anything else to send in the response, the header should be 'close'

How to post to an internal URL in classic asp from server

How to post to an internal URL in classic asp from server?
Using MSXML2.ServerXMLHTTP looks not work per this and this
I cannot use Response.Redirect since I need to send http code 200 right after I receive the request
I cannot use either Server.Execute or Server.Transfer since I want to modify Form collection before posting to destination internal URL
Thank you
Update:
I create an classic ASP endpoint to accept request from a third party. And I need to send back a response with HTTP status code 200. Then this endpoint doesn't process anything but needs to post the request to an internal endpoint for processing. Hope this clear now.
Khoi

How to change OPTION method to POST?

I use the next link in order to send chunking files with plupload.
I change the url parameter in order to send the request to my localhost:
url: "./upload.cfm", was changes to url: "localhost/upload"
As I see, the request is sent, but with request methods: OPTIONS.
Why it happens and how I can change it to POST?
Since you are now making a cross-origin HTTP request, you are triggering a preflight request in which the browser asks the destination server if your website is allowed to ask browsers to make POST requests to the destination server.
Either configure the destination server to respond to the OPTIONS request with a response granting permissions (after getting that response the browser will make the POST request), or continue to make requests with XHR only to the same origin.

ASP.NET form losing POST values in a proxy environment

I have an ASP.NET form (a login page), when I POST the values to the server, the request passes through a proxy and the POST pareameters end up getting lost and ultimately the page just refreshes as there are no POST parameters.
The thing is that this is not a constant issue as sometimes you can log in fine and generally if you clear your browser temp files it then works ok.
I ran Fiddler to check what's going on and basically I'm getting:
A regular POST request containing session id, POST data etc. The response (HTTP 407) contains a Proxy-Authenticate: Negotiate and Proxy-Support: Session-Based-Authentication header
The next request to the server contains a Proxy-Authorization: Negotiate header containing a long string (base64 i think). This request does NOT contain the POST values. The response is another 407 and actually now that i look at it Fiddler displays 'HTTP/1.1 407 Proxy Authentication Required ( Access is denied. )' as the header.
Then there's a third request that contains the Proxy-Authorization header and returns 200 OK, but of course the POST values weren't sent
Subsequent requests result in a HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ) response followed by a second successful but empty request.
The client wont let me bypass the proxy as it's intermittent and all other pages in the application (that include plenty of web forms) work fine.
Any ideas on what I can try?

Resources