Java API content-type

2 views
Skip to first unread message

thai.t...@gmail.com

unread,
Feb 6, 2010, 2:49:39 AM2/6/10
to Digg API
I have this very strange issue with using the signpost oauth setHeader
method. Basically, I'm doing:

request.setHeader("Content-Type", "application/x-www-form-
urlencoded");

However, using WireShark to see traffic, 'Content-Type' got converted
it to 'content-type'. Thus, Digg API returned "Invalid content type
for POST request". Anyone know how to solve this?

thai.t...@gmail.com

unread,
Feb 6, 2010, 2:56:56 AM2/6/10
to Digg API
Also, if it's not too much to ask, would it be possible for the API to
support both lower case and the normal way? This should help with
different browsers and clients. Thanks!

On Feb 6, 1:49 am, "thai.t.hu...@gmail.com" <thai.t.hu...@gmail.com>
wrote:

David Strack

unread,
Feb 6, 2010, 4:09:09 PM2/6/10
to Digg API
I'm also getting this response now with a JSON API request. I sent an
email to Jeff @ Digg about the error and now I'm waiting for a
response.

On Feb 6, 1:56 am, "thai.t.hu...@gmail.com" <thai.t.hu...@gmail.com>
wrote:

thai.t...@gmail.com

unread,
Feb 8, 2010, 3:29:59 AM2/8/10
to Digg API
Are you building an android application by any chance? Seems like this
issue happens for android applications.

David Strack

unread,
Feb 8, 2010, 10:30:52 AM2/8/10
to Digg API
Nope, Palm webOS :) It's Javascript based so all this OAuth and POST
stuff is a little tricky, it seems.

On Feb 8, 2:29 am, "thai.t.hu...@gmail.com" <thai.t.hu...@gmail.com>
wrote:

Jeff Hodsdon

unread,
Feb 8, 2010, 4:01:40 PM2/8/10
to dig...@googlegroups.com
Ah this is the case. We only accept 'Content-Type' rather than an all lower case 'content-type'. Let me try and fit this in.

-jeff

> --
> You received this message because you are subscribed to the Google Groups "Digg API" group.
> To post to this group, send email to dig...@googlegroups.com.
> To unsubscribe from this group, send email to diggapi+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/diggapi?hl=en.
>

thai.t...@gmail.com

unread,
Feb 8, 2010, 4:20:22 PM2/8/10
to Digg API
I already found a fix for this for java. It was the HttpURLConnection
that caused it. I had to end up using the HttpPost for making the
request.

David Strack

unread,
Feb 9, 2010, 1:03:07 PM2/9/10
to Digg API
I think this is the issue I'm having now too. Using Prototype I think
it automatically sets it as 'content-type.' If you can allow it to
accept lowercase, I think I'll finally be able to complete OAuth
requests!

On Feb 8, 3:20 pm, "thai.t.hu...@gmail.com" <thai.t.hu...@gmail.com>
wrote:

Reply all
Reply to author
Forward
0 new messages