# HTTP Requests lead to Plugin-crashing?

**URL:** <https://forums.plex.tv/t/http-requests-lead-to-plugin-crashing/30697>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [March 14, 2013, 9:08pm UTC](https://forums.plex.tv/t/http-requests-lead-to-plugin-crashing/30697 "2013-03-14T21:08:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![baa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/baa/32/2026_2.png) [@baa](https://forums.plex.tv/u/baa)\
**Post date:** [March 14, 2013, 9:08pm UTC](https://forums.plex.tv/t/http-requests-lead-to-plugin-crashing/30697/1 "2013-03-14T21:08:50Z")

</div>

Hello...

trying to understand the PMS communication I am shooting HTTP requests against it.

Things look quite good, for example i get the following "talk":

&nbsp;

\*\*\* request

[http://192.168.178.20:32400/channels/](http://192.168.178.20:32400/channels/)

\*\*\* reply

xmlIOHTTP - bytes read: 178

\<?xml version="1.0" encoding="UTF-8"?\>

&nbsp;

Digging deeper however, I read back the following:

&nbsp;

\*\*\* request

[http://192.168.178.20:32400/video/abc](http://192.168.178.20:32400/video/abc)

\*\*\* reply

xmlIOHTTP - bytes read: 934

\<?xml version='1.0' encoding='utf-8'?\>

&nbsp; Traceback (most recent call last):

&nbsp; File "/Users/baa/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 822, in handle\_request

&nbsp; &nbsp; result = f(\*\*d)

&nbsp; File "/Users/baa/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/handlers/base.py", line 119, in call

&nbsp; &nbsp; result = self.func(\*args, \*\*kwargs)

&nbsp; File "/Users/baa/Library/Application Support/Plex Media Server/Plug-ins/ABC.bundle/Contents/Code/\_\_init\_\_.py", line 23, in MainMenu

&nbsp; &nbsp; if not Client.Platform in ('iOS') and not (Client.Platform == 'Safari' and Platform.OS == 'MacOSX'):

TypeError: 'in \<string\>' requires string as left operand

&nbsp;

...somehow indicating, that my plugin kind of crashed.

Same message is shown in plugin's log as well ("CRITICAL EXCEPTION"), the PMS log however is clean.

Is there anything I forgot to set up in order to keep the plugins happy???

---

<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:** [March 16, 2013, 8:51pm UTC](https://forums.plex.tv/t/http-requests-lead-to-plugin-crashing/30697/2 "2013-03-16T20:51:00Z")

</div>

> ...somehow indicating, that my plugin kind of crashed.

The plugin errored because the value of _Client.Platform_ is _None_ when you browse the XML data like you are doing. This has [just been fixed](https://github.com/plexinc-plugins/ABC.bundle/commit/71c414ded27b9051942e787e8abbc9c1362d48aa).

---

<div class="post-metadata">

**Author:** ![baa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/baa/32/2026_2.png) [@baa](https://forums.plex.tv/u/baa)\
**Post date:** [March 16, 2013, 9:57pm UTC](https://forums.plex.tv/t/http-requests-lead-to-plugin-crashing/30697/3 "2013-03-16T21:57:46Z")

</div>

> ... you browse the XML data like you are doing. ...

Thanks for the fix. But how am I supposed to browse PMS? Isn't this the way everyone does?

I guess, I am confused...

---

<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, 11:02pm UTC](https://forums.plex.tv/t/http-requests-lead-to-plugin-crashing/30697/4 "2019-12-20T23:02:41Z")

</div>

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