question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can i remove the added [] from POST array data?

See original GitHub issue

Noticed that this line url/index/serialize function add the [] directly to the array data in the params, but with some backend language like java, it default not support array data with [] but with dulplicate names like: form data:

//This will not work:
id: 1,
gids[]: 123,
gids[]: 234
//This will work:
id: 1,
gids: 123,
gids: 234

So how about make [] a option to configure just like ng-file-upload using arrayKey: '[i]' or '[]' or '.i' or '' //default is '[i]' to adapt to different server implementations ?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
taotao365scommented, Apr 21, 2017

@savokiss , you can use post method directly. In the backend server (eg, springMVC) , you can use @RequestBody, get param info from request body qq 20170421155811

after all, it just avoid your case. It’s hard to see how it could be true

0reactions
qianxiansheng90commented, Dec 25, 2018

@smallpath does this have option to fix post array without prefix [] ? I also have problem in go.

Read more comments on GitHub >

github_iconTop Results From Across the Web

php - How to remove elements from the $_POST array?
simply go: unset($_POST['field']);.
Read more >
Use data operations in Power Automate (contains video)
Although you can add or remove elements by using the select action, you can't change the number of objects in the array.
Read more >
Removing Array Element and Re-Indexing in PHP
In order to remove an element from an array, we can use unset() function which removes the element from an array and then...
Read more >
Removing Items from an Array in JavaScript
In this article, we'll explore a few different ways to remove an item from an array in JavaScript. I will also show you...
Read more >
How to remove a variable from a PHP session array
I have PHP code that is used to add variables to a session: ... method="post"> <input type="submit" name="remove" value="Remove" /> </form>.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found