how to post associative array in ionic 3How is OAuth 2 different from OAuth 1?google oauth2 grant_type=authorization_code returns Error processing OAuth 2 requestOAuth access token and refresh token creationPHP Console Application with OAuth 2.0 Refresh Tokens, how to store?Ember oauth2 Authentication issuesIonic/Laravel App Client Side Auth Managementregister new user from api route using laravel passportHow to use Laravel Passport with Password Grant Tokens?Angular 6 http post request with x-www-form-urlencoded dataAuthenticate in Microsoft Graph server side application
What does オト mean here?
Why is this int array not passed as an object vararg array?
How to minimise the cost of guessing a number in a high/low guess game?
Exception propagation: When should I catch exceptions?
The CompuTaria Quest - A young Wizard's journey
How did Thanos not realise this had happened at the end of Endgame?
Why was Thor doubtful about his worthiness to Mjolnir?
Run script for 10 times until meets the condition, but break the loop if it meets the condition during iteration
What does i386 mean on macOS Mojave?
Does kinetic energy warp spacetime?
Repair a file using Audacity?
What is the best way for a skeleton to impersonate human without using magic?
use the oversamplling followed by '' decimation method ''to increasee the ADC resolution and not normal averaging
Can I make ravioli dough with only all-purpose flour or do I NEED semolina flour?
Why does the Earth follow an elliptical trajectory rather than a parabolic one?
Do atomic orbitals "pulse" in time?
What are the components of a legend (in the sense of a tale, not a figure legend)?
Create a list of all possible Boolean configurations of three constraints
"Right on the tip of my tongue" meaning?
Why do Thanos's punches not kill Captain America or at least cause some mortal injuries?
What stroke width Instagram is using for its icons and how to get same results?
What's special about a Bunsen burner?
How to slow yourself down (for playing nice with others)
Renting a house to a graduate student in my department
how to post associative array in ionic 3
How is OAuth 2 different from OAuth 1?google oauth2 grant_type=authorization_code returns Error processing OAuth 2 requestOAuth access token and refresh token creationPHP Console Application with OAuth 2.0 Refresh Tokens, how to store?Ember oauth2 Authentication issuesIonic/Laravel App Client Side Auth Managementregister new user from api route using laravel passportHow to use Laravel Passport with Password Grant Tokens?Angular 6 http post request with x-www-form-urlencoded dataAuthenticate in Microsoft Graph server side application
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
When i try to post a data in associative array to rest api using ionic.
Only empty data receive in server side.
Is this method is correct or suggest any other method
public login(credentials)
let apiUrl = this.urlService.apiUrl + 'oauth/access_token';
let headers = new Headers('Content-Type' : 'application/x-www-form-urlencoded');
let options = new RequestOptions(
headers: headers);
var postcredn=new Array();
postcredn['username'] = "karthik@abcde.in";
postcredn['password'] = "05550";
postcredn['grant_type'] = "password";
postcredn['client_id'] = "Outfit1548669";
postcredn['client_secret'] = "a10620c85033abd17716cda245";
console.log('iii'+postcredn['username'] );
return new Promise((resolve, reject) =>
this.http.post(apiUrl, postcredn, options)
.subscribe(res =>
resolve(JSON.parse(JSON.stringify(res)));
console.log('json'+ JSON.stringify(postcredn));
, (err) =>
reject(err);
console.log(apiUrl);
);
);
} console.log(apiUrl);
});
});
}
}
Thanks in advance
laravel authentication ionic-framework oauth ionic3
add a comment |
When i try to post a data in associative array to rest api using ionic.
Only empty data receive in server side.
Is this method is correct or suggest any other method
public login(credentials)
let apiUrl = this.urlService.apiUrl + 'oauth/access_token';
let headers = new Headers('Content-Type' : 'application/x-www-form-urlencoded');
let options = new RequestOptions(
headers: headers);
var postcredn=new Array();
postcredn['username'] = "karthik@abcde.in";
postcredn['password'] = "05550";
postcredn['grant_type'] = "password";
postcredn['client_id'] = "Outfit1548669";
postcredn['client_secret'] = "a10620c85033abd17716cda245";
console.log('iii'+postcredn['username'] );
return new Promise((resolve, reject) =>
this.http.post(apiUrl, postcredn, options)
.subscribe(res =>
resolve(JSON.parse(JSON.stringify(res)));
console.log('json'+ JSON.stringify(postcredn));
, (err) =>
reject(err);
console.log(apiUrl);
);
);
} console.log(apiUrl);
});
});
}
}
Thanks in advance
laravel authentication ionic-framework oauth ionic3
add a comment |
When i try to post a data in associative array to rest api using ionic.
Only empty data receive in server side.
Is this method is correct or suggest any other method
public login(credentials)
let apiUrl = this.urlService.apiUrl + 'oauth/access_token';
let headers = new Headers('Content-Type' : 'application/x-www-form-urlencoded');
let options = new RequestOptions(
headers: headers);
var postcredn=new Array();
postcredn['username'] = "karthik@abcde.in";
postcredn['password'] = "05550";
postcredn['grant_type'] = "password";
postcredn['client_id'] = "Outfit1548669";
postcredn['client_secret'] = "a10620c85033abd17716cda245";
console.log('iii'+postcredn['username'] );
return new Promise((resolve, reject) =>
this.http.post(apiUrl, postcredn, options)
.subscribe(res =>
resolve(JSON.parse(JSON.stringify(res)));
console.log('json'+ JSON.stringify(postcredn));
, (err) =>
reject(err);
console.log(apiUrl);
);
);
} console.log(apiUrl);
});
});
}
}
Thanks in advance
laravel authentication ionic-framework oauth ionic3
When i try to post a data in associative array to rest api using ionic.
Only empty data receive in server side.
Is this method is correct or suggest any other method
public login(credentials)
let apiUrl = this.urlService.apiUrl + 'oauth/access_token';
let headers = new Headers('Content-Type' : 'application/x-www-form-urlencoded');
let options = new RequestOptions(
headers: headers);
var postcredn=new Array();
postcredn['username'] = "karthik@abcde.in";
postcredn['password'] = "05550";
postcredn['grant_type'] = "password";
postcredn['client_id'] = "Outfit1548669";
postcredn['client_secret'] = "a10620c85033abd17716cda245";
console.log('iii'+postcredn['username'] );
return new Promise((resolve, reject) =>
this.http.post(apiUrl, postcredn, options)
.subscribe(res =>
resolve(JSON.parse(JSON.stringify(res)));
console.log('json'+ JSON.stringify(postcredn));
, (err) =>
reject(err);
console.log(apiUrl);
);
);
} console.log(apiUrl);
});
});
}
}
Thanks in advance
laravel authentication ionic-framework oauth ionic3
laravel authentication ionic-framework oauth ionic3
edited Mar 23 at 11:40
Karthik
asked Mar 23 at 11:00
KarthikKarthik
1,44041941
1,44041941
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Please rewrite following code:
First you need to create interface like:
export interface Postdata
username: String;
password:String;
grant_type:String;
client_id: String;
client_secret: String;
Then import it and set its value:
var postcredn:Postdata;
postcredn=
username:'karthik@abcde.in',
password:'05550',
grant_type:'password',
client_id:'Outfit1548669',
client_secret:'a10620c85033abd17716cda245'
Finally post it via post method:
return new Promise((resolve, reject) =>
this.http.post(apiUrl, postcredn, options)
.subscribe(res =>
resolve(JSON.parse(JSON.stringify(res)));
console.log('json'+ JSON.stringify(postcredn));
, (err) =>
reject(err);
console.log(apiUrl);
);
);


While trying this code. it shows an "TypeError: "postcredn is undefined" " @Utpaul
– Karthik
Mar 25 at 5:34
can you update your file....
– Utpaul
Mar 25 at 5:38
Now check @Karthik ...
– Utpaul
Mar 25 at 6:09
codepen.io/Gokulanathan/pen/JzzGNE please see my code on this link.
– Karthik
Mar 25 at 6:12
@Karthik i already update my code please check it ...
– Utpaul
Mar 25 at 6:13
|
show 4 more comments
Associative arrays in Javascript are technically Objects and can't be instantiated via new Array(). To create one you can use any of new Object() or . So from the code you posted, you will define it as var postcredn=new Object(); or var postcredn=;
In your Laravel code, you can access it as you would an associative array in PHP.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55312997%2fhow-to-post-associative-array-in-ionic-3%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Please rewrite following code:
First you need to create interface like:
export interface Postdata
username: String;
password:String;
grant_type:String;
client_id: String;
client_secret: String;
Then import it and set its value:
var postcredn:Postdata;
postcredn=
username:'karthik@abcde.in',
password:'05550',
grant_type:'password',
client_id:'Outfit1548669',
client_secret:'a10620c85033abd17716cda245'
Finally post it via post method:
return new Promise((resolve, reject) =>
this.http.post(apiUrl, postcredn, options)
.subscribe(res =>
resolve(JSON.parse(JSON.stringify(res)));
console.log('json'+ JSON.stringify(postcredn));
, (err) =>
reject(err);
console.log(apiUrl);
);
);


While trying this code. it shows an "TypeError: "postcredn is undefined" " @Utpaul
– Karthik
Mar 25 at 5:34
can you update your file....
– Utpaul
Mar 25 at 5:38
Now check @Karthik ...
– Utpaul
Mar 25 at 6:09
codepen.io/Gokulanathan/pen/JzzGNE please see my code on this link.
– Karthik
Mar 25 at 6:12
@Karthik i already update my code please check it ...
– Utpaul
Mar 25 at 6:13
|
show 4 more comments
Please rewrite following code:
First you need to create interface like:
export interface Postdata
username: String;
password:String;
grant_type:String;
client_id: String;
client_secret: String;
Then import it and set its value:
var postcredn:Postdata;
postcredn=
username:'karthik@abcde.in',
password:'05550',
grant_type:'password',
client_id:'Outfit1548669',
client_secret:'a10620c85033abd17716cda245'
Finally post it via post method:
return new Promise((resolve, reject) =>
this.http.post(apiUrl, postcredn, options)
.subscribe(res =>
resolve(JSON.parse(JSON.stringify(res)));
console.log('json'+ JSON.stringify(postcredn));
, (err) =>
reject(err);
console.log(apiUrl);
);
);


While trying this code. it shows an "TypeError: "postcredn is undefined" " @Utpaul
– Karthik
Mar 25 at 5:34
can you update your file....
– Utpaul
Mar 25 at 5:38
Now check @Karthik ...
– Utpaul
Mar 25 at 6:09
codepen.io/Gokulanathan/pen/JzzGNE please see my code on this link.
– Karthik
Mar 25 at 6:12
@Karthik i already update my code please check it ...
– Utpaul
Mar 25 at 6:13
|
show 4 more comments
Please rewrite following code:
First you need to create interface like:
export interface Postdata
username: String;
password:String;
grant_type:String;
client_id: String;
client_secret: String;
Then import it and set its value:
var postcredn:Postdata;
postcredn=
username:'karthik@abcde.in',
password:'05550',
grant_type:'password',
client_id:'Outfit1548669',
client_secret:'a10620c85033abd17716cda245'
Finally post it via post method:
return new Promise((resolve, reject) =>
this.http.post(apiUrl, postcredn, options)
.subscribe(res =>
resolve(JSON.parse(JSON.stringify(res)));
console.log('json'+ JSON.stringify(postcredn));
, (err) =>
reject(err);
console.log(apiUrl);
);
);


Please rewrite following code:
First you need to create interface like:
export interface Postdata
username: String;
password:String;
grant_type:String;
client_id: String;
client_secret: String;
Then import it and set its value:
var postcredn:Postdata;
postcredn=
username:'karthik@abcde.in',
password:'05550',
grant_type:'password',
client_id:'Outfit1548669',
client_secret:'a10620c85033abd17716cda245'
Finally post it via post method:
return new Promise((resolve, reject) =>
this.http.post(apiUrl, postcredn, options)
.subscribe(res =>
resolve(JSON.parse(JSON.stringify(res)));
console.log('json'+ JSON.stringify(postcredn));
, (err) =>
reject(err);
console.log(apiUrl);
);
);


edited Mar 25 at 6:41
answered Mar 24 at 9:45
UtpaulUtpaul
1,2792419
1,2792419
While trying this code. it shows an "TypeError: "postcredn is undefined" " @Utpaul
– Karthik
Mar 25 at 5:34
can you update your file....
– Utpaul
Mar 25 at 5:38
Now check @Karthik ...
– Utpaul
Mar 25 at 6:09
codepen.io/Gokulanathan/pen/JzzGNE please see my code on this link.
– Karthik
Mar 25 at 6:12
@Karthik i already update my code please check it ...
– Utpaul
Mar 25 at 6:13
|
show 4 more comments
While trying this code. it shows an "TypeError: "postcredn is undefined" " @Utpaul
– Karthik
Mar 25 at 5:34
can you update your file....
– Utpaul
Mar 25 at 5:38
Now check @Karthik ...
– Utpaul
Mar 25 at 6:09
codepen.io/Gokulanathan/pen/JzzGNE please see my code on this link.
– Karthik
Mar 25 at 6:12
@Karthik i already update my code please check it ...
– Utpaul
Mar 25 at 6:13
While trying this code. it shows an "TypeError: "postcredn is undefined" " @Utpaul
– Karthik
Mar 25 at 5:34
While trying this code. it shows an "TypeError: "postcredn is undefined" " @Utpaul
– Karthik
Mar 25 at 5:34
can you update your file....
– Utpaul
Mar 25 at 5:38
can you update your file....
– Utpaul
Mar 25 at 5:38
Now check @Karthik ...
– Utpaul
Mar 25 at 6:09
Now check @Karthik ...
– Utpaul
Mar 25 at 6:09
codepen.io/Gokulanathan/pen/JzzGNE please see my code on this link.
– Karthik
Mar 25 at 6:12
codepen.io/Gokulanathan/pen/JzzGNE please see my code on this link.
– Karthik
Mar 25 at 6:12
@Karthik i already update my code please check it ...
– Utpaul
Mar 25 at 6:13
@Karthik i already update my code please check it ...
– Utpaul
Mar 25 at 6:13
|
show 4 more comments
Associative arrays in Javascript are technically Objects and can't be instantiated via new Array(). To create one you can use any of new Object() or . So from the code you posted, you will define it as var postcredn=new Object(); or var postcredn=;
In your Laravel code, you can access it as you would an associative array in PHP.
add a comment |
Associative arrays in Javascript are technically Objects and can't be instantiated via new Array(). To create one you can use any of new Object() or . So from the code you posted, you will define it as var postcredn=new Object(); or var postcredn=;
In your Laravel code, you can access it as you would an associative array in PHP.
add a comment |
Associative arrays in Javascript are technically Objects and can't be instantiated via new Array(). To create one you can use any of new Object() or . So from the code you posted, you will define it as var postcredn=new Object(); or var postcredn=;
In your Laravel code, you can access it as you would an associative array in PHP.
Associative arrays in Javascript are technically Objects and can't be instantiated via new Array(). To create one you can use any of new Object() or . So from the code you posted, you will define it as var postcredn=new Object(); or var postcredn=;
In your Laravel code, you can access it as you would an associative array in PHP.
answered Mar 23 at 13:10
Ikenna Anthony OkaforIkenna Anthony Okafor
376317
376317
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55312997%2fhow-to-post-associative-array-in-ionic-3%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown