# HTTP Post

**URL:** <https://forums.plex.tv/t/http-post/4411>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [August 16, 2010, 4:41pm UTC](https://forums.plex.tv/t/http-post/4411 "2010-08-16T16:41:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaaps](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jaaps/32/1373_2.png) [@jaaps](https://forums.plex.tv/u/jaaps)\
**Post date:** [August 16, 2010, 4:41pm UTC](https://forums.plex.tv/t/http-post/4411/1 "2010-08-16T16:41:36Z")

</div>

I’m trying to develop a plugin for a certain website. I want to get some videos from it but it needs to submit a form with the POST method.  
  
What is the best way to send this form and get the returned content as an XML object (or something I can use xpath on)?   
  
  
  
Hope anyone can help me.  
  
  
  
Thanks

---

<div class="post-metadata">

**Author:** ![sander1](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@sander1](https://forums.plex.tv/u/sander1)\
**Post date:** [August 16, 2010, 5:23pm UTC](https://forums.plex.tv/t/http-post/4411/2 "2010-08-16T17:23:15Z")

</div>

Hi jaaps!  
  
Using POST is not very different from a “normal” GET. The difference is in the _values_ parameter. Here is a simple example that does a POST request with a username and password:

```auto

post_values = {<br />
  'username' : 'sander1',<br />
  'password' : 'terces'<br />
}<br />
<br />
content = XML.ElementFromURL('http://www.website.com', isHTML=True, values=post_values)

```

  
Now you can do xpath queries on \*content\*.

---

<div class="post-metadata">

**Author:** ![jaaps](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jaaps/32/1373_2.png) [@jaaps](https://forums.plex.tv/u/jaaps)\
**Post date:** [August 16, 2010, 7:18pm UTC](https://forums.plex.tv/t/http-post/4411/3 "2010-08-16T19:18:23Z")

</div>

Thanks, works perfectly!   
  
  
  
Now I have another question: How do I clear cookies set by a website?

---

<div class="post-metadata">

**Author:** ![elan](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/elan/32/5_2.png) [@elan](https://forums.plex.tv/u/elan)\
**Post date:** [August 16, 2010, 8:49pm UTC](https://forums.plex.tv/t/http-post/4411/4 "2010-08-16T20:49:40Z")

</div>

Great question, I’m not sure if that’s supported, I will ask Jam about it!

---

<div class="post-metadata">

**Author:** ![elan](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/elan/32/5_2.png) [@elan](https://forums.plex.tv/u/elan)\
**Post date:** [August 16, 2010, 9:26pm UTC](https://forums.plex.tv/t/http-post/4411/5 "2010-08-16T21:26:06Z")

</div>

There is an HTTP.ClearCookies() added in the next version of the Framework, so that should meet your needs.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 8:41pm UTC](https://forums.plex.tv/t/http-post/4411/6 "2019-12-20T20:41:02Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
