Skip to content

POST issue #17

@david-lopez

Description

@david-lopez

Hello Xavier!

Thanks for this amazing plugin. I've a problem testing my app using curl to POST a new object.
I'm not sure if it's a configuration issue or a bad request generation. It seems that server is getting headers from the request but not accepting content. This is an example of what I'm doing:

curl -i -H "Accept:application/json" -H "Content-Type:application/json" -X POST -d '{"name":"BlaBla","logo":"blabla","description":"blalba","created_at":"2012-01-23 00:00:00", "updated_at":"2012-01-23 00:00:00"}"' http://api.com/api.php/canal.json

The request is not acceptable (also tryed without escaping " ").

After some testing and edditing the executeCreate and parsePayload functions at server-side, I was able to generat e a "fake" post, creating a new header and adding the content to it as shown below.

curl -i -H "Accept:application/json" -H "Content-Type:application/json"
-H
"Content:{"name":"BlaBla","logo":"blabla","description":"blalba","created_at":"2012-01-23 00:00:00", "updated_at":"2012-01-23 00:00:00"}" http://api.com/api.php/canal.json -X POST -d ''

Accepted/200.

However, I know this is not the proper way to do it, so I would like to solve it.

Many thanks in advance!

David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions