I'm using Locust to run a load test, to my surprise all of the POST APIs I tried calling from it returns "Internal Server Error - 500", but if I run the same APIs from JMeter they run well. I checked and saw like LocustIO prepends and apostrophe at the end of each call. This is a screen shot
This is my setup code:
from locust import HttpLocust, TaskSet, task
class justTestApi(TaskSet):
@task(1)
def accountInquiry(self):
self.client.post("/users", {
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
});
class WebsiteUser(HttpLocust):
task_set = justTestApi
min_wait = 5000
max_wait = 9000
host = "https://jsonplaceholder.typicode.com"
stop_timeout = 200