<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164212</link>
    <title>MATLAB Central Newsreader - urlread passing special characters</title>
    <description>Feed for thread: urlread passing special characters</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 20 Feb 2008 22:08:02 -0500</pubDate>
      <title>urlread passing special characters</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164212#416434</link>
      <author>Michele </author>
      <description>Help!  I need to do a urlread with a GET method and a&lt;br&gt;
parameter that contains slashes, eg.&lt;br&gt;
&lt;br&gt;
urlread ('&lt;a href=&quot;http://192.168.0.253&quot;&gt;http://192.168.0.253&lt;/a&gt;', 'GET',&lt;br&gt;
{'/goform/getdevicestatus', ''})&lt;br&gt;
&lt;br&gt;
The problem is that urlread translates the / (hex 2F) into&lt;br&gt;
the 3 character string '%2F' in the actual TCP packet data&lt;br&gt;
that gets sent out.  This is similar to the problem I had&lt;br&gt;
last year getting urlread to take base64 encoded passwords.&lt;br&gt;
&amp;nbsp;That one was solved by using&lt;br&gt;
urlConnection.setRequestProperty.  Unfortunately, I don't&lt;br&gt;
know if I can do that in this case, or how to do it.  I'm&lt;br&gt;
not sure what &quot;property&quot; I might need to use.&lt;br&gt;
&lt;br&gt;
So my question is, is there a way in Matlab to assemble a&lt;br&gt;
TCP packet that includes special characters in the data? &lt;br&gt;
Any and all help would be greatly appreciated.  Thanks!</description>
    </item>
    <item>
      <pubDate>Wed, 20 Feb 2008 22:30:04 -0500</pubDate>
      <title>Re: urlread passing special characters</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164212#416440</link>
      <author>Matthew Simoneau</author>
      <description>URLREAD is encoding these because the GET needs to be a&lt;br&gt;
valid URL.  Shouldn't whatever's on the other end be&lt;br&gt;
decoding these?</description>
    </item>
    <item>
      <pubDate>Thu, 21 Feb 2008 01:35:03 -0500</pubDate>
      <title>Re: urlread passing special characters</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164212#416472</link>
      <author>Michele </author>
      <description>&quot;Matthew Simoneau&quot; &amp;lt;matthew@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fpi9lc$fkh$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; URLREAD is encoding these because the GET needs to be a&lt;br&gt;
&amp;gt; valid URL.  Shouldn't whatever's on the other end be&lt;br&gt;
&amp;gt; decoding these?&lt;br&gt;
&lt;br&gt;
That's really an excellent question.  To avoid any&lt;br&gt;
embarrassment to the manufacturer of the device I'm trying&lt;br&gt;
to talk to, I'll refer to it simply as a &quot;Frobniz 43&quot; -&lt;br&gt;
that's not its real name.  (Its real name is the HRGZ-01&lt;br&gt;
Z-Wave Gateway by Hawking Technology).&lt;br&gt;
&lt;br&gt;
All I can tell you is that when I send an HTTP &quot;get device&lt;br&gt;
status&quot; command to the Frobniz using the web client provided&lt;br&gt;
by Hawking, the packet comes out as&lt;br&gt;
'/goform/getdevicestatus' on the wire.  When I try to&lt;br&gt;
emulate that in Matlab using urlread, it comes out as&lt;br&gt;
'%2Fgoform%2Fgetdevicestatus' and I get back an error&lt;br&gt;
message from Matlab &quot;Error downloading URL.&quot;.&lt;br&gt;
&lt;br&gt;
The URL itself is valid, because I do get an appropriate&lt;br&gt;
response when I do a plain urlread on the server without a&lt;br&gt;
getdevicestatus request.&lt;br&gt;
&lt;br&gt;
Considering the overall quality of the rest of their&lt;br&gt;
software, its unlikely the Frobniz Corp. is going to repair&lt;br&gt;
their reader, so my only other hope is to somehow coerce&lt;br&gt;
Matlab into feeding the Gateway some data it would find more&lt;br&gt;
palatable.&lt;br&gt;
&lt;br&gt;
I'm sure this would be handy for other peoples' problems&lt;br&gt;
too.  Is there any workaround for this?  Thanks (and thanks&lt;br&gt;
again for your help on the last go-around too).</description>
    </item>
    <item>
      <pubDate>Thu, 21 Feb 2008 02:29:02 -0500</pubDate>
      <title>Re: urlread passing special characters</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164212#416474</link>
      <author>Matthew Simoneau</author>
      <description>Maybe you don't want to send this as a parameter after all,&lt;br&gt;
but just as part of the URL.  Does this work?&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; urlread('&lt;a href=&quot;http://192.168.0.253/goform/getdevicestatus&quot;&gt;http://192.168.0.253/goform/getdevicestatus&lt;/a&gt;')</description>
    </item>
    <item>
      <pubDate>Thu, 21 Feb 2008 18:09:01 -0500</pubDate>
      <title>Re: urlread passing special characters</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164212#416624</link>
      <author>Michele </author>
      <description>&quot;Matthew Simoneau&quot; &amp;lt;matthew@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fpi9lc$fkh$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; URLREAD is encoding these because the GET needs to be a&lt;br&gt;
&amp;gt; valid URL.  Shouldn't whatever's on the other end be&lt;br&gt;
&amp;gt; decoding these?&lt;br&gt;
&lt;br&gt;
That's really an excellent question.  To avoid any&lt;br&gt;
embarrassment to the manufacturer of the device I'm trying&lt;br&gt;
to talk to, I'll refer to it simply as a &quot;Frobniz 43&quot; -&lt;br&gt;
that's not its real name.  (Its real name is the HRGZ-01&lt;br&gt;
Z-Wave Gateway by Hawking Technology).&lt;br&gt;
&lt;br&gt;
All I can tell you is that when I send an HTTP &quot;get device&lt;br&gt;
status&quot; command to the Frobniz using the web client provided&lt;br&gt;
by Hawking, the packet comes out as&lt;br&gt;
'/goform/getdevicestatus' on the wire.  When I try to&lt;br&gt;
emulate that in Matlab using urlread, it comes out as&lt;br&gt;
'%2Fgoform%2Fgetdevicestatus' and I get back an error&lt;br&gt;
message from Matlab &quot;Error downloading URL.&quot;.&lt;br&gt;
&lt;br&gt;
The URL itself is valid, because I do get an appropriate&lt;br&gt;
response when I do a plain urlread on the server without a&lt;br&gt;
getdevicestatus request.&lt;br&gt;
&lt;br&gt;
Considering the overall quality of the rest of their&lt;br&gt;
software, its unlikely the Frobniz Corp. is going to repair&lt;br&gt;
their reader, so my only other hope is to somehow coerce&lt;br&gt;
Matlab into feeding the Gateway some data it would find more&lt;br&gt;
palatable.&lt;br&gt;
&lt;br&gt;
I'm sure this would be handy for other peoples' problems&lt;br&gt;
too.  Is there any workaround for this?  Thanks (and thanks&lt;br&gt;
again for your help on the last go-around too).</description>
    </item>
    <item>
      <pubDate>Thu, 21 Feb 2008 18:28:01 -0500</pubDate>
      <title>Re: urlread passing special characters</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164212#416628</link>
      <author>Michele </author>
      <description>&quot;Matthew Simoneau&quot; &amp;lt;matthew@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fpinle$e5l$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Maybe you don't want to send this as a parameter after all,&lt;br&gt;
&amp;gt; but just as part of the URL.  Does this work?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; urlread('&lt;a href=&quot;http://192.168.0.253/goform/getdevicestatus&quot;&gt;http://192.168.0.253/goform/getdevicestatus&lt;/a&gt;')&lt;br&gt;
&lt;br&gt;
Sigh... this is a perfect example of how sometimes you get&lt;br&gt;
so hung up on complexities that you totally forget about the&lt;br&gt;
obvious.  (Putting on the Homer Simpson accent) &quot;DOHHH!&quot;&lt;br&gt;
&lt;br&gt;
Yes, of course, that was it.  That works fine.  Thanks - I&lt;br&gt;
owe you two now :-)</description>
    </item>
  </channel>
</rss>

