Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Import["http://.."] wackiness.... ?

18 views
Skip to first unread message

Jason Ledbetter

unread,
Oct 17, 2008, 5:22:14 AM10/17/08
to
Folk,
I've written a notebook that allows me to process a set of data from a local
data file e.g., Import[ToFileName[....]].

This data is also available via an HTTP web service that returns
text/plain.

When I try to use Import["http://thatservice"], Mathematica returns
"Disallowed Key Characters." and I'm unable to find any reference to what
that means via google.

If I 'wget' or 'curl' http://thatservice and then Import the saved file, the
notebook processes the data just fine.

The best I can figure Import w/ an http url probably wants real html and not
plain text.

Does anyone know of a way around this (other than the obvious of externally
copying said data and importing locally)?

Thanks,

-jbl

Jason Ledbetter

unread,
Oct 17, 2008, 5:22:25 AM10/17/08
to
Looks like it was the servlet providing the service that is broken, not
Import -- sorry for the intrusion.

Jason Ledbetter

unread,
Oct 17, 2008, 5:22:57 AM10/17/08
to
For Posterity, the "problem" here was that the target http service is
running a php engine called "CodeIgnitor" that defaults to denying any
cookies with a $ in their name.
According to RFC2109, that would be broken. Mathematica's Import[] works the
first time against the servlet then fails the second time.. the reason is
that on the first Import, the servlet sets a cookie so Mathematica requests
$Path, $Domain, $Version on follow-up queries.

It looks like the appropriate response for the webserver would be to return
Path, Domain and Version on the next response but instead it [CodeIgnitor]
defaults to denying the request.

-jbl

magma

unread,
Oct 19, 2008, 5:40:50 AM10/19/08
to
On Oct 17, 11:22 am, "Jason Ledbetter" <jasonbr...@gmail.com> wrote:
> For Posterity, the "problem" here was that the target http service is
> running a php engine called "CodeIgnitor" that defaults to denying any
> cookies with a $ in their name.
> According to RFC2109, that would be broken. Mathematica's Import[] works =

the
> first time against the servlet then fails the second time.. the reason is
> that on the first Import, the servlet sets a cookie so Mathematica reques=

ts
> $Path, $Domain, $Version on follow-up queries.
>
> It looks like the appropriate response for the webserver would be to retu=
rn
> Path, Domain and Version on the next response but instead it [CodeIgnitor=

]
> defaults to denying the request.
>
> -jbl
>
> On Thu, Oct 16, 2008 at 6:08 PM, Jason Ledbetter <jasonbr...@gmail.com>wr=

ote:
>
> > Looks like it was the servlet providing the service that is broken, not
> > Import -- sorry for the intrusion.
>
> > On Thu, Oct 16, 2008 at 5:59 PM, Jason Ledbetter <jasonbr...@gmail.com>=

wrote:
>
> >> Folk,
> >> I've written a notebook that allows me to process a set of data from a
> >> local data file e.g., Import[ToFileName[....]].
>
> >> This data is also available via an HTTP web service that returns
> >> text/plain.
>
> >> When I try to use Import["http://thatservice"], Mathematica returns
> >> "Disallowed Key Characters." and I'm unable to find any reference to w=

hat
> >> that means via google.
>
> >> If I 'wget' or 'curl'http://thatserviceand then Import the saved file,

> >> the notebook processes the data just fine.
>
> >> The best I can figure Import w/ an http url probably wants real html a=

nd
> >> not plain text.
>
> >> Does anyone know of a way around this (other than the obvious of
> >> externally copying said data and importing locally)?
>
> >> Thanks,
>
> >> -jbl

What server/service was it?

Jason Ledbetter

unread,
Oct 21, 2008, 1:44:09 AM10/21/08
to
Something written w/ CodeIgnitor (http://www.codeignitor.com/).
Incidentally apparently fixed as of
http://codeigniter.com/forums/viewthread/94111/ (version 1.7 of the
framework)

-jbl

On Sun, Oct 19, 2008 at 5:40 AM, magma <made...@gmail.com> wrote:

> ...snip...
> What server/service was it?
>
>

0 new messages