Re: metaweblog again.

Kimbro Staken <[email protected]> Sat, 1 Nov 2003 20:14:20 -0700
Newsgroups gmane.comp.web.syncato.general
Message-ID <[email protected]>
That should work, that's all addCategory.py does anyway.

On Nov 1, 2003, at 8:28 PM, darryl wrote:

>>>
>>
> Just wondering if you can 'POST' categories (my terminology is not 
> good)
> like below:
> --------------------------------------------------------------
> import httplib
> import libxml2
> import sys
> entry = """<category id="XML">
>   <title>XML</title>
>  <description>Stuff about XML</description>
> </category>
> """
>
> def runRequest(method,url,body=None):
>    conn = httplib.HTTPConnection("localhost")
>    headers = {"Content-type": "text/xml"}
>    conn.request(method, url, body, headers)
>
>    result = conn.getresponse()
>
>    if (result.status == 401):
>        token = "Basic " + encodestring(USERNAME + ":" + 
> PASSWORD).strip()
>        headers = {"Content-type": "text/xml", "Authorization": token}
>        conn.close()
>
>        conn.request(method,url,body,headers)
>
>        result = conn.getresponse()
>
>    return result
> baseURL = "htp://localhost/WK/blog/"
> result = runRequest("POST",baseURL,entry)
> print result.status, result.reason
>
> -------------------------------------------------------------
>
> above doesn't really work as it doesn't yield categories like on your 
> site :)
>
> No reason to go off-list, i guess i did a reply instead of reply-all.
>
> -cheers
> darryl
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?   SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Syncato-general mailing list
> Syncato-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/syncato-general
>
>
Kimbro Staken
Software, Consulting and Writing http://www.xmldatabases.org/
Apache Xindice native XML database http://xml.apache.org/xindice
XML:DB Initiative http://www.xmldb.org



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/