-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to read stream of file in k6 #1002
Comments
In my project there is no .go file.Is there any other way to read the stream of file in k6 in simpler way. |
I don't understand why you would need |
Actually I want to pass the file stream to request body to my api. Later on this stream is used to further process |
What you want is to send that pdf over http to your api, correct? In that case what I have proposed will work for you. The #612 PR was about reading big files in small parts .. unfortunately this would not work ... well in clustered execution and because of that was not merged. |
I tried this but I am always getting unathorised error because API needs stream input & using http.file we are passing binary file. |
@d5gwsw, what exactly do you mean by a file stream? Can you tell me what HTTP feature/RFC you specifically need? |
I need below input to my api. In without k6 I am using like this- above code in typescript using node js. stream should be like this which I am getting through above code without k6:= |
I'm sorry, but k6 isn't built on top of Node.js and it doesn't support the Node.js APIs. Some JS libraries that rely on some node APIs may work when passed through browerify (more info), but usually not the ones that require access to the file system. I don't know why in your case it's important to read the file as a stream, and why the Also, I'll close this issue, since the github issues are not the most appropriate place to ask "how to" questions. A much more appropriate place would be the community forum, or as you've found out, Stack Overflow. If you have a specific feature suggestion for k6, other than streaming reading of files, feel free to open a new issue. |
No description provided.
The text was updated successfully, but these errors were encountered: