Getting '400-: Bad request for new customer -- need POST' on newCustomer() call PHP Client Lib

Mike Vosters's Avatar

Mike Vosters

24 Oct, 2012 02:00 PM

Hi

I am getting the following error whenever I try to use the api to create a new customer. Just a simple API request to newCustomer while populating it with verified and valid data.
400-: Bad request for new customer -- need POST

Can you guys help me debugging this issue, I have traced the request down to the curl statements(I switched the HTTP adapter to Curl and Zend Request both) and curl is getting proper post fields and post is being set to true, but I don't understand why this problem would exist.

Thanks

  1. Support Staff 1 Posted by Marc Guyer on 24 Oct, 2012 02:12 PM

    Marc Guyer's Avatar

    Strange. It sounds like you've already gotten down to your own troubleshooting.

    The best I can do right now is tell you that that error is returned simply when the request method is something other than POST.

  2. 2 Posted by Mike Vosters on 24 Oct, 2012 03:10 PM

    Mike Vosters's Avatar

    I fixed the problem.

    So I used command line Curl to make the same requests and it worked fine(and I used the values received by curladapter by dumping them to the screen and then using the precise values to create the curl request.

    The api gateway url was set as http://cheddargetter.com and at that url I was getting a 301 moved permanently error, the URL should have been https://cheddargetter.com This 301 redirect works fine when you just need to make a get request, but with POST requests something goes wrong and Curl returns a cryptic and unhelpful message of 'bad request'. You guys should check the api request handler and see if it could identify a request made through redirection and return something more relevant instead of "bad request".

    Overall great job guys, thanks.

  3. Marc Guyer closed this discussion on 12 Nov, 2012 02:29 PM.

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM