Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: REST::Client POST error

by roboticus (Chancellor)
on Aug 30, 2017 at 22:07 UTC ( [id://1198362]=note: print w/replies, xml ) Need Help??


in reply to REST::Client POST error

sannag:

Since 400 is a "Bad Request" according to Wikipedia, I'd expect that your URL isn't correct or a similar problem.

You might try visiting the site with Chrome and using the Developer tools panel to capture an actual interaction with the site and compare it with the values you're trying to use in your code.

Update: I just notice that your code is saying that you'll be posting form-encoded data, then you encode a JSON document, and don't include it in the POST. I think you're skipping a step or two...

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: REST::Client POST error
by sannag (Sexton) on Aug 30, 2017 at 22:27 UTC

    I used Chrom ''Postman' rest client and was able to post and get a reply back. Sorry about the json encoding part, corrected the code the include the $bodyData in the post url

Re^2: REST::Client POST error
by sannag (Sexton) on Aug 31, 2017 at 13:59 UTC
    You are correct! I was just not smart to recognize it early on.....I was putting the content in json it should be in htttp format. I have a fix on it now and it is working :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1198362]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-19 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found