CODE SAMPLE 1
passJSONObj(){
let name = 'user names',
let email = '[email protected]'
return this._http.get('url?name=usernames&[email protected]');
}
CODE SAMPLE 2
passJSONObj(){
let param = {
name: 'usernames',
email: '[email protected]'
}
return this._http.get('url', param);
}
Code sample 1 works fine but code sample 2 does not. I want to know the reason. I've made research but I haven't understand why such a simple code won't work
getsimply does not have a parameter for json data, if you need to send additional data with your request, you can for example usepostAccess-Control-Allowto accept and parse the data properly