Usually adding the parameters into the URL works .. why would it not  
in this case?

I get the same error (400) if I set the params in the code

        URL connoU = new URL("http://www.connotea.org/data/add";);
                        
        HttpURLConnection conno = (HttpURLConnection) connoU.openConnection();
        conno.setRequestProperty("User-Agent", "WWW::Connotea");
        conno.setRequestProperty("uri", URLEncoder.encode(uri,"UTF-8"));
        conno.setRequestProperty("tag", URLEncoder.encode(tag,"UTF-8"));
        conno.setRequestMethod("POST");

I've been digging for some else that has this running in Java, but  
the only one I could find (from Pierre Lindenbaum) didn't use the web  
api - it emulated a user session by storing and sending cookies for  
authentication and sending requests including button clicks.  (His  
ConnoteaClient program - but it doesn't seem to be work ing anymore).

-Ben


On Aug 2, 2007, at 4:57 PM, Martin Flack wrote:

> Your example does not seem to set a payload though. The URL should  
> be free of parameters and their should be content that contains the  
> parameters, encoded with application/x-www-form-urlencoded.
>
> Benjamin Good wrote:
>> Had already tried that one (as well as pretending to be a browser).
>> Doing my best to figure out what the difference is.. but no luck  
>> so far.  Here is the method I'm using (authentication not included  
>> but working fine).
>> -ben
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Connotea-code-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/connotea-code-devel

Reply via email to