Dan K. wrote:
What was the actual issue?
I would just add a field to your post, client = c++ version 0.9. You
could even use a custom HTTP User Agent header. I think .xhr is
confusing paradigms for no reason.
Thanks for hanging in there
I should have pointed this out, my apologies! The actual issue seems to
have been with the C++ component that I was using. I tried a number of
combinations and tried to even trace the actual headers that were sent.
I found that the size of the “content” was always larger by a few bytes
than what I expected (this wasn’t clearly documented in the help files,
so I don’t know what it’s doung!) I think it was doing some encoding
that was messing up things. I did eventually do a search related to the
component and found that many people had faced a similar problem… and
recommended migrating to another freeware component instead. When I
switched to the new component and followed the example, it worked just
fine! (Actually, it gives me another error but that I can solve!)
I do not want to go down the .xhr path to create different results for
my program - I am more keen to use either “Accepts” or perhaps another
field for this job. Actually, using another field seems to be the
easier and more elegant solution… I’d prefer to avoid having to
receive HTML in the C++ program and then try to figure out the actual
codes embedded in the HTML…
What do you guys think about using a separate action in the
controller… so, I post to “/categories/create_from_pcclient” instead
of “/categories/create”? I’m not sure how I can prevent it being
accessed from the web in that case…
Thanks… if you have any suggestions, do send in
Now on to more interesting things
1- stitching together all the parameters that need to be submitted
(in my C++ program)
This should be simple enough to do
2- understand the response to make sure it succeeded (in my C++ program)
Depends on solution to #3…
3- seeing if it’s possible to create a different kind of response for
POSTs received from this program (on the Rails sides)
Thanks for the inputs…
4 - working through authentication
Hmmm… I think this needs cookies… I have to see what’s required from
my C++ program to maintain user sessions!
Anyway, I’m enjoying this project!