Skip to content

Instantly share code, notes, and snippets.

@sgnl
Last active January 15, 2016 01:15
Show Gist options
  • Save sgnl/f85abdfc71e3b501e6e3 to your computer and use it in GitHub Desktop.
Save sgnl/f85abdfc71e3b501e6e3 to your computer and use it in GitHub Desktop.

Revisions

  1. sgnl revised this gist Jan 15, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fix.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    in **server.js file**
    ```javascript
    server.use(bodyParser.urlencoded({ extended: true})); // remove this line
    server.use(bodyParser.json({ type: 'application/*+json' })); //replace with this line
    server.use(bodyParser.json({ type: 'application/json' })); //replace with this line
    ```

    in **Postman:**
  2. sgnl revised this gist Jan 14, 2016. 1 changed file with 2 additions and 7 deletions.
    9 changes: 2 additions & 7 deletions fix.md
    Original file line number Diff line number Diff line change
    @@ -6,11 +6,6 @@ server.use(bodyParser.json({ type: 'application/*+json' })); //replace with this

    in **Postman:**

    **Headers:**

    ![image](https://cloud.githubusercontent.com/assets/3915598/12339547/a1fcc1f8-bab9-11e5-9bcf-9c8999727ff2.png)

    **Body:**

    ![image](https://cloud.githubusercontent.com/assets/3915598/12339761/c592279c-baba-11e5-9167-10b9d3d85f56.png)
    ![image](https://cloud.githubusercontent.com/assets/3915598/12339790/0dfdfca4-babb-11e5-85c4-c33869c0945a.png)

    Notice the "JSON (application/json)" setting.
  3. sgnl revised this gist Jan 14, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions fix.md
    Original file line number Diff line number Diff line change
    @@ -5,9 +5,12 @@ server.use(bodyParser.json({ type: 'application/*+json' })); //replace with this
    ```

    in **Postman:**

    **Headers:**

    ![image](https://cloud.githubusercontent.com/assets/3915598/12339547/a1fcc1f8-bab9-11e5-9bcf-9c8999727ff2.png)

    **Body:**

    ![image](https://cloud.githubusercontent.com/assets/3915598/12339761/c592279c-baba-11e5-9167-10b9d3d85f56.png)

  4. sgnl renamed this gist Jan 14, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. sgnl created this gist Jan 14, 2016.
    13 changes: 13 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    in **server.js file**
    ```javascript
    server.use(bodyParser.urlencoded({ extended: true})); // remove this line
    server.use(bodyParser.json({ type: 'application/*+json' })); //replace with this line
    ```

    in **Postman:**
    **Headers:**
    ![image](https://cloud.githubusercontent.com/assets/3915598/12339547/a1fcc1f8-bab9-11e5-9bcf-9c8999727ff2.png)

    **Body:**
    ![image](https://cloud.githubusercontent.com/assets/3915598/12339761/c592279c-baba-11e5-9167-10b9d3d85f56.png)