Skip to content

Instantly share code, notes, and snippets.

@DeepLinkCode
Forked from akexorcist/index.js
Created April 12, 2020 20:53
Show Gist options
  • Save DeepLinkCode/96764bb32d124bb6509034f8ea4dcce0 to your computer and use it in GitHub Desktop.
Save DeepLinkCode/96764bb32d124bb6509034f8ea4dcce0 to your computer and use it in GitHub Desktop.

Revisions

  1. @akexorcist akexorcist revised this gist Aug 14, 2019. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    const axios = require('axios')
    const qs = require('querystring')

    ...

    @@ -16,7 +17,7 @@ const config = {
    }
    }

    axios.post(url, requestBody, config)
    axios.post(url, qs.stringify(requestBody), config)
    .then((result) => {
    // Do somthing
    })
  2. @akexorcist akexorcist created this gist Jan 3, 2018.
    25 changes: 25 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    const axios = require('axios')

    ...

    const requestBody = {
    name: 'Akexorcist',
    age: '28',
    position: 'Android Developer',
    description: 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/',
    awesome: true
    }

    const config = {
    headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
    }
    }

    axios.post(url, requestBody, config)
    .then((result) => {
    // Do somthing
    })
    .catch((err) => {
    // Do somthing
    })