Hello
I’m using Gatling community version 9 with Java 17 to send a GraphQL request with some certificate data and got a 400, enabled debugging but the response body is binary content and can’t see the details of what is wrong. Here is the output from the run
HTTP request:
POST http://localhost:9091/query
headers:
accept: */*
user-agent: Gatling/Performance Test
Content-Type: application/json;
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjBDNEM5NTVFNjM2OEFBODNENzg2QjdGMUMxNjk...8y6LHxNVAmuxSpoYG2fnhTbm8jEXV3a3cueHPzoxR4zy7GFQgYK69rbU6s4SE4a72ecWD9hGo6GwWv0gpa5M2OzA
host: localhost:9091
content-length: 1296
body:StringChunksRequestBody{charset=UTF-8, content={"query" : "mutation {certificateSigningRequest(input: {request: \"-----BEGIN CERTIFICATE REQUEST-----\\nMIIDITCCAgkCAQAwezELMAkGA1UEBhMCQkcxDjAMBgNVBAgTBVNvZmlhMQ4wDAYDVQQHEwVTb2ZpYTEPMA0GA1UEChMGVmVuYWZpMQswCQYDVQQLEwJRQ...LJbqxMuiTW0AnJri+3FOvpizjIIuE77EV6sD3WX+bGiPOoY0+Pv8ek3QIVhBieQg1rEGC9bQh5Ii1wuvjXgzETS0HNEgWYCBFES6UQUEQWKcvr+LR3XuBiw==\\n-----END CERTIFICATE REQUEST-----\", policyName: \"policy-xyz\",validityPeriod: \"P2D\"}) {certificateChain}}"}}
=========================
HTTP response:
status:
400 Bad Request
body:
<<<BINARY CONTENT>>>
I’m using StringBody() in Java like this
.exec(http("Create Signing Request")
.post("/query")
.header("Content-Type", "application/json")
.header("Authorization","Bearer " + Token)
.body(StringBody("{\"query\" : \"mutation {certificateSigningRequest(input: {request: " + CSR + ", policyName: \\\"policy-xyz\\\",validityPeriod: \\\"P2D\\\"}) {certificateChain}}\"}"))
Token and CSR are passed in variables, if I pass the same request body from Gatling output to curl, the curl request is successful.
Is there a way to see the details of the 400 error?
Thank you!