1

I have this chunk of code in my controller.js file

$http({
    method: 'GET',
    url: '/getGuestList',
    params: {exhibitorID: 1}
})

Basically, it's supposed to get all the guests of a certain exhibitor whose exhibitor ID is 1.

On the server side, I have tried logging req.body.params and req.body.exhibitorID but both of them are undefined. I'm just getting familiar with angularjs and I don't know what I'm missing.

Your help will be very much appreciated.

2
  • It would be helpful to know which server technology stack you are using. You may also need to edit your post to include code from the server. Commented Mar 6, 2014 at 5:22
  • Mr. Vendhan had already provided a working answer. Thank you very much for your feedback. I will consider that next time I ask a question. Commented Mar 6, 2014 at 10:54

2 Answers 2

2

In NodeJS try,

req.query.exhibitorID

API DOCS

Sign up to request clarification or add additional context in comments.

Comments

0

params are req.params, they are not in req.body

5 Comments

yes, i get your point. However, req.params.exhibitorID is still undefined. :(
are you using express? if yes then how your define your routes
this is how I routed it from my app.js: app.get('/getGuestList', routes.getGuestList);
you are not using name route, that's why you need to use req.query
I see. so that's the difference. thank you for this! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.