Updating posts not working?

85 views
Skip to first unread message

Alex Popescu

unread,
Dec 11, 2010, 8:37:44 AM12/11/10
to Posterous development
Hi there,

I have a small little app that is posting to my posterous account
(integrating with my very basic text editor supporting markdown). I'm
noticing that most of the time when updating a post by submitting a
PUT the content doesn't really get updated even if the request returns
a 200.

Here is an example (I've taken out the sensitive info):

PUT http://posterous.com/api/2/users/me/sites/<site_id>/posts/<post_id>?api_token=<api_token>
{params: '{'post[tags]': u'mongodb,video', 'post[title]': 'MongoDB
Videos from MongoSV', 'post[source]': 'blogsyncr', 'post[is_private]':
0, 'post[autopost]': 0, 'post[body]': '<p>... updated post body ....</
p>', 'id': u'post_id', 'post[display_date]': u'2010-12-11 11:59:52
GMT'}', '} => status: 200

After this successful PUT, if I check both the content it is the old
one in both the admin console and the blog. So, what is it:

- am I doing something wrong in that PUT? (if so why not getting back
something else than 200)
- is PUT not working?
- is there some caching mechanism that delays seeing the update? (in
which case I guess a much more appropriate response would be 202: The
request was accepted but not immediately acted upon)

:- alex

Alex Popescu

unread,
Dec 14, 2010, 8:18:46 PM12/14/10
to Posterous development
On Dec 11, 3:37 pm, Alex Popescu <the.mindstorm.mailingl...@gmail.com>
wrote:
> Hi there,
>
> I have a small little app that is posting to my posterous account
> (integrating with my very basic text editor supporting markdown). I'm
> noticing that most of the time when updating a post by submitting a
> PUT the content doesn't really get updated even if the request returns
> a 200.
>
> Here is an example (I've taken out the sensitive info):
>
> PUThttp://posterous.com/api/2/users/me/sites/<site_id>/posts/<post_id>?api_token=<api_token>
> {params: '{'post[tags]': u'mongodb,video', 'post[title]': 'MongoDB
> Videos from MongoSV', 'post[source]': 'blogsyncr', 'post[is_private]':
> 0, 'post[autopost]': 0, 'post[body]': '<p>... updated post body ....</
> p>', 'id': u'post_id', 'post[display_date]': u'2010-12-11 11:59:52
> GMT'}', '} => status: 200
>
> After this successful PUT, if I check both the content it is the old
> one in both the admin console and the blog. So, what is it:
>
> - am I doing something wrong in that PUT? (if so why not getting back
> something else than 200)
> - is PUT not working?
> - is there some caching mechanism that delays seeing the update? (in
> which case I guess a much more appropriate response would be 202: The
> request was accepted but not immediately acted upon)
>

Wondering if anyone from Posterous got a chance to look over this...

tia,

:- alex

> :- alex

Alex Popescu

unread,
Jan 14, 2011, 8:19:59 PM1/14/11
to Posterous development
Bumping this up once again.

I'm kind of concerned to move my blog over Posterous considering
this question has been unanswered for 1 month :(

:- alex
On Dec 15 2010, 3:18 am, Alex Popescu

twoism

unread,
Jan 17, 2011, 2:23:02 PM1/17/11
to Posterous development
I cannot seem to repro this issue. Here is a curl that is working for
me:

curl --user <email>:<pass> -d "_method=put&post[title]=new
title&post[body]=new body&api_token=<token>"
http://posterous.com/api/2/users/me/sites/primary/posts/1609

Can you try that out and let me know if it works for you? Also, how
are generating that request? Could you include a code snippet?

On Jan 14, 5:19 pm, Alex Popescu <the.mindstorm.mailingl...@gmail.com>

Alex Popescu

unread,
Jan 20, 2011, 1:07:39 PM1/20/11
to Posterous development
On Jan 17, 9:23 pm, twoism <signalsta...@gmail.com> wrote:
> I cannot seem to repro this issue. Here is a curl that is working for
> me:
>
> curl --user <email>:<pass> -d "_method=put&post[title]=new
> title&post[body]=new body&api_token=<token>"http://posterous.com/api/2/users/me/sites/primary/posts/1609
>
> Can you try that out and let me know if it works for you? Also, how
> are generating that request? Could you include a code snippet?
>

I'll try it out and report back. At first glance the only difference
is that the api_token is in the URI (my case) vs in the body (your
example)

I'm using Python, but pulling out the code is not so easy as it's
pretty modularized right now.

:- alex
Reply all
Reply to author
Forward
0 new messages