impossible to create a POST

Create issue
Issue #71 resolved
Former user created an issue

It is impossible to create the POST using the blogserver example.

curl -u testuser:foobar "" -F "title=Testing again" -F "content=Foobar"

It seems that both the documentation and the code is outdated.

Comments (7)

  1. Former user Account Deleted

    Here it is a the result I get :

    yml@minnie:blogserver$ curl -u admin:admin "" 
    - author: {username: testuser}
      content: This is just a sample post.
      content_length: 27
      created_on: 2009-04-27 04:55:23
      resource_uri: /api/posts.format
      title: Sample blogpost 1
    - author: {username: testuser}
      content: This is yet another sample post.
      content_length: 32
      created_on: 2009-04-27 04:55:33
      resource_uri: /api/posts.format
      title: Another sample post
    yml@minnie:blogserver$ curl -u admin:admin "" -F "title=Testing again" -F "content=Foobar"
    Bad Requestyml@minnie:blogserver$
  2. Former user Account Deleted

    I continue to document the problem :

    This is where the issue seems to be :

    > /home/yml/workdir/django-piston/piston/
        259         import ipdb; ipdb.set_trace()
    --> 260         if not m.content_type() in realmimes:
        261             return rc.BAD_REQUEST

    Where realmimes and m.content_type() are :

    ipdb> realmimes set(['application/x-yaml', 'application/json', 'text/xml', 'application/python-pickle']) ipdb> m.content_type <bound method Mimer.content_type of <piston.utils.Mimer object at 0xa5228ac>> ipdb> m.content_type() 'multipart/form-data; boundary=----------------------------844993d7526a'

  3. Former user Account Deleted

    Removing the decorator called 'require_extended' before the method create line 49 of avoid this issue.

    I have also try to modify the curl command line without success so far :

    curl -v -u testuser:foobar -H 'Content-Type: application/yaml' -d {'title':'test','content':'super'} ""

  4. Former user Account Deleted

    I have just started to try piston and I am experiencing the same problem: while get works with curl command given in Read Me. post doesn't work. I see this has been marked resolved: "Changed status from new to resolved. Fixed in tip."

    how can I access "tip"?

  5. Log in to comment