Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

POSTs are submitted twice #5

Closed
javiervegas opened this issue Apr 15, 2010 · 1 comment
Closed

POSTs are submitted twice #5

javiervegas opened this issue Apr 15, 2010 · 1 comment

Comments

@javiervegas
Copy link
Contributor

This is more a curb problem than a zendesk-api problem, but posts are submitted twice (because curb does not seem to be handling "100 - Continue" responses well. For deletes this is not a problem (the first works fine and deletes the thing, the second returns a 404), for forum creation is not a problem either (the first one creates the forum fine, the second one returns a 406 "this forum already exists"), but for forum entry it is a problem, both posts work and the entry gets created twice in the forum.
I hacked around the problem replacing curl.http_post(final_body) in main.rb with
system("curl","-v","-u", @username+":"+@password,"-H","Content-Type: application/xml", "-d", final_body, "-X","POST", url) which works for me but assumes that curl is installed and in the path, which will not always be true.

@pgericson
Copy link
Owner

I think I found the answer in this README for curb-fu
http://github.com/gdi/curb-fu

=== Troubleshooting

If you are POSTing data and curb seems to be locking up, try posting it with an explicit 'Expect: 100-continue' header.

You can set this per-request, e.g.
CurbFu.post({:host => 'example.com', :headers => { "Expect" => "100-continue" }}, { "data" => "here" })
or you can configure it as a global header, e.g.
CurbFu.global_headers = { "Expect" => "100-continue" }

... then make your requests as normal

however you feel best.

I'll try to implement this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants