AliRehman7141
AliRehman7141

Reputation: 993

React Native Axios JavaScript how to pass an array of strings as params in GET requrest

I am using the Axios for API calls, I need to send an array of strings in a GET Request how can I add my list in params(in URL)

Upvotes: 1

Views: 1006

Answers (1)

Nooruddin Lakhani
Nooruddin Lakhani

Reputation: 6967

This might help

import axios from 'axios';

axios.get('/api', {
    params: {
      data: JSON.stringify(data)
    }
  })
  .then(function (response) {
    console.log(response);
  })

Upvotes: 3

Related Questions