You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to perform stress test on a http api with pb format, but, how to send http request in protobuf format by locust(instead, jmeter supports pb format) .
Is this the same with uploading file?
`files = {
'image': open('sample.jpg', 'rb'),
}
As far as I know, protobuf is just a format for serializing/deserializing structured data - with existing libraries for python - so there shouldn't be any problem using it with Locust.
Exactly how depends on how the server expects the data to get transfered. If it expects it to be transfered as a multipart file upload you would use the files keyword argument (http://docs.python-requests.org/en/master/user/quickstart/#post-a-multipart-encoded-file). However, if I would guess, I would think that it's more likely that the data were to be transfered as raw data in the POST body:
We want to perform stress test on a http api with pb format, but, how to send http request in protobuf format by locust(instead, jmeter supports pb format) .
Is this the same with uploading file?
`files = {
'image': open('sample.jpg', 'rb'),
}
r = requests.post('http://localhost:5000/', files=files)`
The text was updated successfully, but these errors were encountered: