Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49185

Fetching data from APIusing POST method

$
0
0

@yogesh1988 wrote:

I am trying to fetch data from api using POST method, i want to add 2 keys in headers.
I did the following code

$http({
url: 'url',
method: 'POST',
data: JSON.stringify({name:fullName, email: email@gmail.com, mobile: 8888888888, password : ********}),
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'X-API-KEY': 'key'
}
})

but it seems to be not working, I am having problem with sending 2 headers with API call.
Please help me out .
Thanks in Advance.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49185

Trending Articles