zerocode icon indicating copy to clipboard operation
zerocode copied to clipboard

Sending raw string in urlencoded data field #question

Open automatedbegginer opened this issue 6 years ago • 4 comments
trafficstars

Hello,

I have the following data to send:

  "name": "post_message",
  "url": "some/url",
  "operation": "POST",
  "request": {
    "headers": {
      "Content-Type": "application/x-www-form-urlencoded"
    },
    "body": {
      "id": "84844",
      "data": "SOME*DATA\nMORE*DATA",
    }
  }

When I follow TCP stream, in request I get encoded data "data=SOME*DATA%5CnMORE&id=84844".

  1. Is there any way to send raw data in this field without encoding?
  2. Is there any way to preserve parameter ordering (id&data instead of data&id)?

automatedbegginer avatar Oct 24 '19 15:10 automatedbegginer

Hello @automatedbegginer ,

"data=SOME*DATA%5CnMORE&id=84844"

I believe the Apache Http client encodes this, the framework doesn't encode.

@arunvelusamyd , can you put some thought to this, please? You have dealt with quite a lot of realtime use cases(those definitely might help). Appreciate your help mate!

authorjapps avatar Oct 26 '19 10:10 authorjapps

@automatedbegginer I think when you use x-www-form-urlencoded the body is automatically encoded as in case of url. maybe try application/json ? @authorjapps is this issue still relevant?

sparrowV avatar May 04 '20 13:05 sparrowV

Thanks @sparrowV . @automatedbegginer, can you reply ?

authorjapps avatar Jul 29 '20 09:07 authorjapps

Hi, i needed to use x-www-form-urlencoded to simulate messages between two apps. They send eachother x-www-form-urlencoded data, not json. I dont know any more details, since the issue is few months old :)

automatedbegginer avatar Jul 29 '20 09:07 automatedbegginer

Looks like a Duplicate of https://github.com/authorjapps/zerocode/issues/141

Reopen if it's not the case.

nirmalchandra avatar Apr 16 '23 20:04 nirmalchandra