Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post request as API is not working #59

Open
uniqueanurag opened this issue Apr 19, 2020 · 0 comments
Open

Post request as API is not working #59

uniqueanurag opened this issue Apr 19, 2020 · 0 comments

Comments

@uniqueanurag
Copy link

Hi,
I'm hitting below URL i can view the below data
https://localhost/rest-api/songs/loginStats/Administrator/Anurag/yug

[{"first_name":"Yug","last_name":"Sinha","token":"3242746237678236578346","roll":"Administrator","last_login":"2020-04-02 00:34:41","user_type":"Administrator"}]

When i'm requesting using Angular 8 I'm getting error only

const headers = new HttpHeaders()
.append('Content-Type', 'application/json')
.append('Access-Control-Allow-Headers', 'Content-Type')
.append('Access-Control-Allow-Methods', 'GET')
.append('Access-Control-Allow-Origin', '*');
return this.http.post(${environment.apiUrl}/songs/loginStats, { usertype,username, password },{headers: headers})
.pipe(map(user => {

payload parameter not coming in function

Regards
Anurag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant