Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-8

OPTIONS HTTP method cannot return JSON response but 405 method

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Resolution: Cannot Reproduce
    • None
    • Aluminium SR1
    • restconf-nb
    • None
    • Operating System: All
      Platform: All

    Description

      Testing this I expected a HTTP "OPTIONS" request in both XML and JSON formats to return 200 and a payload describing the OPTIONS available. The XML test was successful, but the JSON test failed and threw a 405 HTTP ERROR.

      ###Test setup ###

      install this http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf/0.2.0-SNAPSHOT/distribution-karaf-0.2.0-20141002.195140-199.zip.sha1

      ###Steps

      Create a data resource

      curl -v -X POST -d "<nodes xmlns=\"urn:opendaylight:inventory\"><node><id>id1</id></node></nodes>" localhost:8080/restconf/config/ --header "Content-Type:application/xml" --header "Accept:application/xml"

      Verify it was present

      curl -v -X GET 172.29.50.236:8080/re "Content-Type:application/xml" --header "Accept:application/xml"

      Now I tried to check the OPTIONS, looks ok with XML

      curl -v -X OPTIONS 172.29.50.236:8080/restconf/config/opendaylight-inventory:nodes/node/id1 "Content-Type:application/xml" --header "Accept:application/xml

      This returns XML you can see it in the attachment.

      curl -v -X OPTIONS 172.29.50.236:8080/restconf/config/opendaylight-inventory:nodes/node/id1 "Content-Type:application/xml" --header "Accept:application/json

      returns $)% status and a HTML page with a tomcat error message

      "The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers."

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ricjhill@gmail.com RichardHill
            ricjhill@gmail.com RichardHill
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h