HTTP 404 when using API with the recommended Accept header

458 views
Skip to first unread message

Jeff

unread,
Jun 20, 2016, 1:29:28 PM6/20/16
to GoCD User Mailing List
This has been plaguing me and wondered if I'm doing something wrong.

I'm hitting the GoCD API to schedule a pipeline.  According to the instructions at https://api.go.cd/current/#current-version it states:

Inline image 1
However when I include the accept header:
User-Agent: Fiddler
Confirm: true
Accept: "application/vnd.go.cd.v1+json"
Content-Length: 0
Authorization: Basic c3ZjV2ViUHscUV2VsY29tZTE=

I get the error:
HTTP/1.1 404 Not Found
Date: Mon, 20 Jun 2016 17:16:38 GMT
Set-Cookie: JSESSIONID=120k1lcwfm28k1vgbnno8erbgu;Path=/go;Expires=Mon, 04-Jul-2016 17:16:38 GMT;Secure
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: chrome=1
Content-Type: application/vnd.go.cd.v1+json; charset=utf-8
Cache-Control: no-cache
X-Request-Id: 5b661b21-ad19-4919-8148-2fde6146fc83
X-Runtime: 0.006000
Transfer-Encoding: chunked

3D
{
  "message": "The resource you requested was not found!"
}

0

If I simply omit the "Accept" header, it works fine.  Am I doing something wrong because it seems that either the document is wrong or there is a bug and it is frustrating.

Thanks!

--
Jeff Vincent
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent

Jeff

unread,
Jun 20, 2016, 1:30:21 PM6/20/16
to GoCD User Mailing List
I should note that I'm using GoCD v.16.3.0.

Aravind SV

unread,
Jun 20, 2016, 1:34:24 PM6/20/16
to go...@googlegroups.com
I suspect it is because of it being an old API and the accept header being newer. Changing the old API to expect the new header will mean a breaking change for everyone. My experience has been that the examples provided in the documentation are correct, and I tend to use that.

Ketan or someone else might have a better idea or thoughts about changing it to optionally accept that header, maybe.

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff

unread,
Jun 22, 2016, 11:16:16 AM6/22/16
to GoCD User Mailing List
Optional sounds good!  Thanks for the response.  
Reply all
Reply to author
Forward
0 new messages