aneesh-neelam/VITacademics

404 error when validating users

Closed this issue · 3 comments

kp96 commented

I am trying to use parent login validation in one of my apps. The api is working perfectly with
curl --data "regno=reg&dob=dob&mobile=mob" https://vitacademics-rel.herokuapp.com/api/v2/vellore/login curl but not with request. The status code is always 400. Am I missing something?
Here is my validation code:

request.post({
        url :'https://vitacademics-rel.herokuapp.com/api/v2/vellore/login',
        form : {
            regno : req.body.regno,
            dob : req.body.dob,
            mobile : req.body.phno
        }
    },function(error, response, body) {
        if(!error) {
            var info = JSON.parse(body)
            console.log(info)
            if(info.status.code == 0) {
                res.end('Student details verified !')
            }
            else {
                res.end('Not able to validate your details! Please try later')
            }
        }

    })

maybe, info.status.code == 200

Could you post the repository link for your code base here? I will try and help you out.

None of our client applications are facing the problem, so it is not an issue with the server.

kp96 commented

@rahulkapoor90 That is not what I meant. It is the success code of json response.
@ayushagarwal95 Thanks for the clarification. I will try to work it out on my side.