I have JSON from postman collection and i am iterating the requests list and calling ab from my script. get is working fine.
I have json of request body, how i can send json with ab without using external file.
Related
I am modifying an Apache proxy module mod_proxy_http. I want to inspect the content prior to proxying the request. I am able to use ap_setup_client_block(), ap_should_client_block() and ap_get_client_block() in a loop to retrieve the client request message body. Unfortunately, it also depletes the message body and when the final message reached the API server, the message body is gone.
Is there a non-destructive version of ap_get_client_block() or is there a way to put back the content I read using ap_get_client_block()?
I have been storing the template locally as a HTML file and sending that as part of the body. What is the benefits of storing the templates in AWS SES? Is It that my load for the server is reduced due to not having to send over the HTML on every call made?
I'm currently working on testing my API via Postman and I've noticed that when I send a post request to the endpoint it will successfully send, yet the same POST request will return a "422 Unprocessable entity" error when run as a collection. The 422 error is puzzling to me because syntactically everything checks out. I'm having a hard time understanding what may be the issue here between running the request as a collection versus without doing so, any thoughts on what the issue might be here?
The reason why a request with an attached file fails when run as a collection is probably the location of the attachment. Files uploaded through form-data must be placed in the working directory. Otherwise, the collection runner won't locate them and will send a request with no files attached. This results in 422. It's different from executing individual requests where files can be placed inside any directory.
This issue is also present in newman and can be similarly solved by specifying a working directory with --working-dir and placing files inside of that directory.
I have 10 http requests in http file and want to run them on single click instead of clicking each request and see the output. Subsequent requests use output from previous requests so I want to run them serially in automated way.
At the moment IDEA's text-based HTTP client supports variable substitution and allows to write some simple JavaScript to access response.
All you have to do is create .http file with all your requests defined in a sequence. Then after each request you can add JavaScript block to fill variables that next request(s) require. Example:
### getting json and setting variable retrieved from response body
GET http://httpbin.org/json
> {%
client.global.set("title",response.body["slideshow"]["title"])
%}
### making request using previously set variable as a body
POST http://httpbin.org/anything
Content-Type: text/plain
{{title}}
Next step is running all requests at once like this:
You could use "Run/Debug Configurations", create a few separated files and setup order in window. But you'll get a big task, you cannot wait and setup timeouts for requests.
I guess you should use Jmeter for real work.
You also could try setup simple curl requests in the Linux bases os.
I'm currently working on file uploading in Lucee (deployed on Tomcat).
I'm sending an html form to an API, that keep the file temp. and then send it to our backend through http post request (formfield with payload + file) to invoke a cfc with a proper method.
That request goes to onRequestStart then onCFCRequest that invoke our CFC with our params. A response is returned to our API.
Problem is with file <50 mb it works perfectly but with larger files, the response we are receiving is a dump of the invoked component (without going through onCFCRequest), our file is in our temp folder, the form struct is not empty but our HTTPRequest content is empty.
Already tried to add params to Tomcat and Lucee like
maxHttpHeaderSize and maxPostSize in server.xml
<max-file-size> and <max-request-size>
I'm not getting any errors from Tomcat and Lucee about size limits.
Do you have any idea of what is happening ?
EDIT:
I have found this issue:
http://www.rupeshk.org/blog/index.php/2007/08/coldfusion-8-changes-with-file-upload/
Do you know how can i keep the content on my http request?
Because it's empty (no payload, no file) so it doesn't trigger the onCFCRequest handler. Thanks