bruno icon indicating copy to clipboard operation
bruno copied to clipboard

POST with application/x-www-form-urlencoded and json Body Not Working

Open tkofford opened this issue 2 years ago • 3 comments

The following code does not work, but changing the "body: json" to "body: text" does.

meta { name: POST Test type: http seq: 45 }

post { url: https://some_url/authorize body: json auth: none }

headers { Content-Type: application/x-www-form-urlencoded }

body:json { { "clientId": "some-client-id", "clientSecret": "some-client-secret" } }

tkofford avatar Nov 21 '23 15:11 tkofford

Below are screen prints from what I was describing above. Looks like it "could" be an easy fix since it works with "TEXT" but not with "JSON" body type:

POST-json-Success-bruno POST-json-Error-bruno POST-json-Error-bruno-2

tkofford avatar Dec 28 '23 16:12 tkofford

And there, if the body is set to "form-urlencoded" and a header with a different case is added: "Content-Type":"application/x-www-form-urlencoded", then an error occurs. It works correctly if I use lowercase "content-type":"application/x-www-form-urlencoded"

sendel avatar Jan 09 '25 08:01 sendel

Still happens in 2.1.0 (In previous version, 1.x it worked fine)

Image

If I change the body type to Form URL Encoded and manually enter the values, it works fine. The body is set...

eusebiu avatar Apr 18 '25 16:04 eusebiu