ProxymanApp / ProxymanApp/Proxyman

[Scripting] application/x-www-form-urlencoded body is wrong when using Script

Open
#2,448 1 comment 0 reactions 1 assignee View on GitHub

@NghiaTranUIT is already working on this.

Since Aug 20, 2025.

✅ Done bug
Dominant language
No language data
Stars
7k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

Description

application/x-www-form-urlencoded body is wrong when using Script

Steps to Reproduce

  1. Make this cURL
curl -X POST 'https://httpbin.proxyman.app/post' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'field01=value01' \
  --data-urlencode 'field02=value02' \
  --data-urlencode 'field03=value03' \
  --data-urlencode 'field04=value04' \
  --data-urlencode 'field05=value05' \
  --data-urlencode 'field06=value06' \
  --data-urlencode 'field07=value07' \
  --data-urlencode 'field08=value08' \
  --data-urlencode 'field09=value09' \
  --data-urlencode 'field10=value10' \
  --data-urlencode 'field11=value11' \
  --data-urlencode 'field12=value12' \
  --data-urlencode 'field13=value13' \
  --data-urlencode 'field14=value14' \
  --data-urlencode 'field02=value15' \
  --data-urlencode 'field16=value16' \
  --data-urlencode 'field17=value17' \
  --data-urlencode 'field18=value18' \
  --data-urlencode 'field19=value19' \
  --data-urlencode 'field20=value20' --proxy localhost:9090
  1. Make new Script with this content:
async function onRequest(context, url, request) {
  // console.log(request);
  console.log(url);

  var body = request.body;
  body["new_key"] = "new value"
  request.body = body;

  // Done
  return request;
}

  1. Verify the Form body

Current Behavior

  • Duplicated keys has a [], which is incorrect
    Image

Expected Behavior

  • Should not contain the []

Environment

  • App version: e.g Proxyman 5.23.1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.