Node.js - Send and receive Array as GET/POST using querystring

后端 未结 3 602
太阳男子
太阳男子 2021-01-04 07:39

I\'ve got the following code, but it doesn\'t seem to work:

var post_req = {
    array: [
        [ {
            param1: \'something\',
            param2:          


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-04 08:04

    There is a new node package that fixes this: "npm install qs".

    https://github.com/ljharb/qs

    "query string parser for node supporting nesting, as it was removed from 0.3.x, so this library provides the previous and commonly desired behaviour (and twice as fast)"

    If anyone can tell me why it was removed from 0.3.x, I will give you an upvote for your comment. (I want my confidence in Node.js restored.)

提交回复
热议问题