POST request not working - 02305200

Forum for users and developers of Bullhorn's new REST API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
sandyethadka
User
Posts: 2
Joined: Sun Aug 07, 2016 1:34 pm

POST request not working - 02305200

Post by sandyethadka » Sun Aug 07, 2016 1:41 pm

When I send a POST request like this using Angular it is received by the server with null parameters. Can anyone please tell me what is wrong here?

In the server --
app.post("/signup",function(req,res){
var body = req.body;
console.log(body); // I SEE NULL HERE
res.json(body);
var user_present = 0;
});

In the client--

var req = {
method: 'POST',
url: 'http://localhost:3000/signup',
params: {username:email,password:pass}
};
$http(req).then(function(response){
console.log("test sucesssful");
});
};

In the controller I'm giving the whole link as I have to send the request from an app running in a different port like 8002.

Thanks in advance.

LeAnnN
User
Posts: 5
Joined: Wed Aug 17, 2016 9:50 am

Re: POST request not working - 02305200

Post by LeAnnN » Mon Aug 22, 2016 11:40 am

Hello sandyethadka,

This is LeAnn from Bullhorn Support, and I was hoping to get a little more information from you regarding this question.

When you say you are submitting a POST request, are you referring to a POST request in REST? If so, I would be happy to help you troubleshoot the URLs for the REST call.

Thank you,
LeAnn Nicholson
Technical Support Analyst
Bullhorn Support US: 617-478-9126
Bullhorn Support UK: 44 800 032 2848
Bullhorn Support Australia: 61 28 073 5089
Bullhorn Support International: 617-478-9131

sandyethadka
User
Posts: 2
Joined: Sun Aug 07, 2016 1:34 pm

Re: POST request not working - 02305200

Post by sandyethadka » Tue Aug 23, 2016 10:47 am

Hi LeAnnN

Thanks for your offer for help. Appreciate it. But I found my solution. The issue is related to CORS. That is the keyword which sent me in the right path. Didn't realise that when you do REST calls to another domain(full URL which I mentioned was considered as equivalent to another domain) results in a different approach.

Anybody reading this should maybe Google out CORS and learn them a bit if they are interested in/work with REST calls. Thanks.

Post Reply