I am writing a middleware script and trying to make REST API call in the pre request handler. I am attempting to make a GET call with URL parameters using TykMakeHttpRequest. The documentation page (https://tyk.io/docs/tyk-api-gateway-v-2-0/javascript-plugins/tyk-javascript-api/) does not mention anything about URL params. Also I think that when I add the URL params to the end of “Resource” request field the params get URL encoded leading to 404 error. So what is the correct way to make a request with URL params using TykMakeHttpRequest?
I couldn’t get either AddParams or ExtendedParams to work for me. It looks as though the TykMakeHttpRequest method maps the input to TykJSHttpRequest which has the structure
type TykJSHttpRequest struct {
Method string
Body string
Headers map[string]string
Domain string
Resource string
FormData map[string]string
}