Filtering on Api Platform running into request uri limit - api-platform.com

I am trying to create a set of filters for a resource but am running up against the request uri limit (414 error). I am trying to figure out if there is a way to send the filters in a request body vs as part of the url? Is there another alternative that I am not seeing?

Related

How to send a file through http post using Data Fusion

Wanted to send a file to an http end point url using Data fusion.
Making this http call as a pipeline alert at the completion of the pipeline.
This is not working. Getting 500 response from API. Can someone help me on how do I send the file?
If this can be achieved with http plugin as sink, please let me know the steps.
I doubt you can send files using HTTP. You can create a request using the HTTP plugin as I answered one of your previous question - Data Fusion - Issue with http post plugin.
In HTTP Callback you can find information:
This action can be used when you want to perform an HTTP request at the end of a pipeline run.
Using this plugin, you can send a request or text, not a file.
If you would like to send a file, you should use File like it's mentioned in this thread: Some questions about google Data fusion
Regarding Error 500
The HyperText Transfer Protocol (HTTP) 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
It means that there is an issue with your endpoint. It might be a firewall or HTTP server issue. Too many possibilities of what could be wrong with current details.
In addition, you can find some additional information in doc Ingest CSV data to BigQuery using Cloud Data Fusion - Batch ingestion

Intercept HTTP Request in page

I am trying to make a scraper for a page of a supermarket. I noticed that this supermarket make API HTTP calls via AJAX, and if I enter to Inspect > Network then I can see the request headers of the calls I need.
Inside the requests headers there is an X-Token. If I use this X-Token with the URL via Postman I can get all the info in JSON format, which is better than scraping the web.
The problem is that this X-Token expires (I think, it still works). Is there any possibility to make a call to the page and "intercept" this API call in order to retrieve this X-Token and use it for the next custom requests?
I'am using Ruby on Rails :)

How can I resolve a 403 response code in Jmeter?

I am working with Jmeter to do load testing. I created a simple login script using BlazeMeter. Then I imported the file into Jmeter.
Whenever I try to run the script, it fails. The first problem I encounter here is that in my first http request I receive a 403 response code:
I added a cookie manager and an authorization manager to try and solve this but it is not working. I think the problem is with cors in the manager header as 403 code means that it received the petition but the access to it was denied. Do you have any suggestions on how to resolve this? I tried adding post processors but couldn't make them work. Maybe because I am a newbie to jmeter and load testing. Idk.
As per HTTP Status 403 description
The HTTP 403 Forbidden client error status response code indicates that the server understood the request but refuses to authorize it.
so most probably your request is missing some authentication context.
Your recording seems to be incomplete, you seem to be testing a GeneXus-based application and it is using AJAX_SECURITY_TOKEN header as the security parameter.
From your screenshot it seems that you're sending recorded hard-coded value, however you should design your script as follows:
Perform initial request, i.e. open login page
Extract AJAX_SECURITY_TOKEN header value using Regular Expression Extractor
Substitute this e8985.... recorded value with the JMeter Variable from the Regular Expression Extractor
Check out Using Regular Expressions to Extract Tokens and Session IDs to Variables article for more information.

How to authenticate user when testing REST API using Jmeter

I am trying to make a script to test REST services using Jmeter.
Till now I was using Chrome’s Advanced REST Client.
My authentication request was GET and it was something like this in Advanced REST:
https://username:password#URL:portnumber
its a GET request
Now when I am using Jmeter. I tried following ways:
I added HTTP Authorization Manager and mentioned Base URL and Username/password inside it.
When I am trying to do a request then its showing me “Unauthorized”
I also tried to login using normal https request but no success.
When accessed manually, a authorization popup window appears and username and password is submitted inside this window.
Please suggest me a way for how to login using Jmeter.
Few suggestions:
Most likely you have mismatch in URL you're trying hit and the one, specified in HTTP Authorization Manager, double check it.
Add View Results Tree listener and make sure that the header like:
Authorization: Basic xxxxxxxxxxxx=
is being sent along with the request and compare it with the one, sent by the real browser.
Try switching "Implementation" of your HTTP Request samplers to HttpClient3.1, the easiest way of doing this is using HTTP Request Defaults
And finally, you can use HTTP Header Manager to send the relevant header, it's name should be Authorization and value Basic and username:password encoded in Base64. There is base64Encode function available via JMeter Plugins.

IIS URL Rewrite - Convert POST to GET

In my application there is a client and a WCf REST service. For invoking some wcf service the client is doing an http POST even though the service is a GET.
i do not want to do any changes in the client or the service.
So is there a way where i can convert this POST request to GET and add the data coming in as the POST to the URL and invoke the REST service.
Thanks in advance.
You can use URL Rewrite to issue 3xx Redirect which will use GET method, but you will loose all POST data.
The only safe way known to me is to rewrite POST request to some another custom page, where you:
collect all POST data/variables;
convert them into GET variables (assemble proper GET request);
issue 301 (or 302) Redirect to the proper URL (it will have all POST data sent as GET variables).
Such rewrite to custom page should be easy -- you need to check what method is used (POST or GET) and only invoke it on POST. The rest will be handled in that post-to-get script.
The reason for all of this complexity is the difference in how POST and GET requests work: with GET all data is sent as part of URL while POST uses request body to transfer variable's data.

Resources