TYK for POST params - tyk

I had successfully created an API for GET but failed to do it for POST.
The var1 and var2 in this screenshot should not be null. Please help.

I figured out the issue is when I redirected my server from HTTP to HTTPS thru 301, post data are dropped.
Apache 301 Redirect and preserving post data

Related

Redirect to new domain, missing Post Value

My old mobile app is using digitalocean dedicated ip to access the API from my website.
Now I have new domain for my website, but for some reason I cannot change the ip in my app to the new domain im using now.
When my app sending POST request to the API, the POST request is lost and my API can't get the value. I think its because the redirect process from the ip to domain. Is there a way to access my API from the old ip without losing POST value?
If you are externally redirecting the POST request with a 301 or 302 status then user-agents will usually issue a GET request on the second/redirected request, so your POST data is lost.
For user-agents to preserve the request method through the redirect then you need to issue a 307 (Temporary) or 308 (Permanent) HTTP status code instead.
Reference:
MDN docs - 307 Temporary Redirect
MDN docs - 308 Permanent Redirect

When I send post request in vue.js it generates get request

The code is as simple as
this.$http.post(url, data);
On local machine it generates POST request.
On cloud server it generates GET request.
Version of vue.js is the same.
On localhost request to /example/url/ is processed without redirect but on server request to /example/url/ makes redirect to /example/url (without trailing slash). Because of this POST becomes GET.
I faced this same problem. try to use [HttpPost] attribute in the controller along with the attribute you are using.

GCM URL and 302 redirect response

My Question is regarding GCM URL and 302 redirect response.
When I do curl -v url = https://gcm-http.googleapis.com/gcm/send, I get a 302 response with a new URL populated in location header. My question is, why can't I use the new URL received in 302 redirect always? What is the reason for Google responding with 302 redirect? I would really appreciate detailed explanation.
Many Thanks,
Sushil
Based from this article, error 302 means "Resource temporarily located elsewhere according to the Location header." This seems to be a previously reported issue (with GCM):
https://groups.google.com/forum/#!topic/android-gcm/WwEg6buc-K0
IO Exception while accessing Google Cloud message?
Suggested action is to re-run the request to the provided (temporary, alternate) URL.

API Gateway Redirect 302

I've got a service I'm proxying with gateway. A GET request to / will return a 302 with a Location header. The problem is the value of the Location header which I'm referencing in "integration.response.header.Location" is /login.
What this ends up doing is breaking my proxy by removing the stageName from the AWS provided URL for the API.
Instead of "{AWS_URL}/local/login", the redirect is going to "{AWS_URL}/login" which causes a 403 Forbidden from API Gateway.
If I manually modify the header mapping expression to use 'local/login' all works fine, but, the above should work, no?
Is there some hackery to maybe concat values into a header mapping expression?
Any help is greatly appreciated!
Thanks!
Moved to AWS Forums as it may be more appropriate - https://forums.aws.amazon.com/thread.jspa?threadID=228457

Jmeter error 404

I am trying to load test a webapp, which has following functonality
1. Login in app (setting some cookie variables )
2. Serach customer with some parameter
3. Get detail of particular customer
4. Logout from webapp
When i am running Jmeter i am getting status code 404
Any reference or help will be appriciated.
After googling i found 4** says you have sent bad request.
To check what request has been sent i am using fiddler and capturing original request (which is working from browser ) and request sent by Jmeter , I am comparing data under Inspector tab in Headers in fiddler, Is this right way to resolve the issue of 4**. What else i can do to fix this issue ?
Screen shots attached
I think, the HTTP header manager and HTTP cookie manager must be pushed up just before Recording Controller. Otherwise the requests are made without these header or cookie informations.
If you doing localhost testing should in the cookie manager config domain
localhost:8080.
You can see the request/response in View Results Tree. Just click on the tab Request or Response data respectively. If you're getting a 404, chances are the Response data tab will contain the 404 with (hopefully) information about the values that are invalid or missing.