jhipster Not working the POST REST API

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



jhipster Not working the POST REST API



I want to POST value to an entity in JHIPSTER



I have in my entity name Hussain with one field called name with a type Long



I write this code but it gives me an error 401 if only post a name
and if I add id with it I got 400 error



and i got this error





It seems you are sending a "hussain" with an id (id: "11"). It seems this is not possible. Have you tried it without id?
– vstm
Aug 12 at 14:07


id: "11"





@vstm yes but is not working
– Wald aldera
Aug 12 at 14:10





I am following the example in jhipster API POST method but it is not work
– Wald aldera
Aug 12 at 14:15






In JHipster a POST requires that there is no ID, check HussainResource.java . Please edit your question with details to show what is not working when you POST with only a neme and no id.
– Gaël Marziou
Aug 12 at 16:06





@GaëlMarziou ok I will edit my question
– Wald aldera
Aug 12 at 20:04




1 Answer
1



First of all, you don't have to send id with POST method because id will be created by your back-end.



You get 401 which is unauthorized so you have to find out whether your request is authenticated and unauthorized or not.



You get 400 because of Bad Request.





Ok thanx, I solve my problem but now I have author how I can get Token Bearer Dynamic from JHipster ?
– Wald aldera
Aug 13 at 5:04





for that you can raise another exclusive question...accept and upvote if my answer helped you..thanks
– Alien
Aug 13 at 5:15






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard