Author Topic: REST API - 405 Error on POST  (Read 4338 times)

iolaus

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
REST API - 405 Error on POST
« on: January 10, 2015, 12:34:04 pm »
I've been trying to utilize the REST API using the POST syntax specified in the documentation.  I've been building up a test request in Fiddler but I receive an HTTP 405 response whenever I utilize POST.  I've been using GET requests successfully for quite some time but have been unable to send complex script arguments (presumably because of URL encoding issues).

Any ideas?
« Last Edit: January 10, 2015, 12:48:16 pm by iolaus »

iolaus

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: REST API - 405 Error on POST
« Reply #1 on: January 16, 2015, 10:27:53 pm »
Believe I finally have this figured out.

First off, it appears Elve is expecting an HTTP PUT (as apposed to a POST as specified in the documentation).

Additionally, the content-type in the request header should be:

Content-Type: text/xml

and the request body need to be surrounded by xml tags as follows:

<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">{Elve Command(s) Here}</string>

iostream212

  • Sr. Member
  • ****
  • Posts: 459
    • View Profile
Re: REST API - 405 Error on POST
« Reply #2 on: January 17, 2015, 08:13:31 pm »
awesome you figured this out.  #hacker :)

Sent from my SCH-I545 using Tapatalk

I always wanted to be somebody. In retrospect, I think I should have been more specific.