ZnUnknownHttpVersion

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

ZnUnknownHttpVersion

lanvin.kevin

Sorry for multiple copies.


Hello

I am using a REST API in my web application and I have a problem with the http version.


when I do this kind of request, everything is ok :

    localhost:8080/appName?action=<actionName>&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={}

Parameters are JSON strings.


Now if I just change the last parameter as following, the ZnUnknownHttpVersion error is raised.
      localhost:8080/appName?action=<actionName>&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}


Every special character is converted to %.. excepting ':' .

Thank you 


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ZnUnknownHttpVersion

Sven Van Caekenberghe-2
Hi Kevin,

I am afraid you will have to give more details and preferably something isolated that we can execute against a standard Seaside installation that exposes your problem.

In my image (very recent Pharo 3, Zinc & Seaside 3.1) your last URL is parsed correctly, both to WAUrl as to ZnUrl:

'http://localhost:8080/appName?action=<actionName>&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}' seasideUrl queryFields.

=>

a WARequestFields('action'->'<actionName>' 'firstParameter'->'["Value"]' 'secondParameter'->'["Value"]' 'lastParameter'->'{ "Key":["firstValue","secondValue"]}')

'http://localhost:8080/appName?action=<actionName>&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}' asZnUrl query.

=>

a ZnMultiValueDictionary('action'->'<actionName>' 'firstParameter'->'["Value"]' 'lastParameter'->'{ "Key":["firstValue","secondValue"]}' 'secondParameter'->'["Value"]' )

Sven

On 06 Mar 2014, at 14:49, [hidden email] wrote:

> Sorry for multiple copies.
>
>
>
> Hello
>
> I am using a REST API in my web application and I have a problem with the http version.
>
>
>
> when I do this kind of request, everything is ok :
>
>     localhost:8080/appName?action=<actionName>&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={}
>
> Parameters are JSON strings.
>
>
>
> Now if I just change the last parameter as following, the ZnUnknownHttpVersion error is raised.
>       localhost:8080/appName?action=<actionName>&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}
>
>
>
> Every special character is converted to %.. excepting ':' .
>
> Thank you
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ZnUnknownHttpVersion

lanvin.kevin
In reply to this post by lanvin.kevin
Hi sven,

Thank you for your response.

 

The problem is that the request is not even sent from the Client to the Server.

 

 

Try to do this in a Workspace to get my error, a server must be running on the given port :

 

 

ZnClient get: 'http://localhost:8080/appName?action=&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ZnUnknownHttpVersion

lanvin.kevin
In reply to this post by lanvin.kevin

It's working on a seaside server, but not on a RestServer.

This code should show you the problem.


| server |

server := ZnServer startOn: 1700 .

server delegate: 

(ZnRestServerDelegate new 

uriSpace: (ZnCallHierarchyRestUriSpace new 

rootClass: ZnExampleSumRestCall;

yourself); 

yourself).





(ZnClient new) get: 'http://localhost:1700/appName?action=&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}'


Regards.


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ZnUnknownHttpVersion

Sven Van Caekenberghe-2
Kevin,

On 06 Mar 2014, at 16:55, [hidden email] wrote:

> It's working on a seaside server, but not on a RestServer.
> This code should show you the problem.
>
> | server |
> server := ZnServer startOn: 1700 .
> server delegate:
> (ZnRestServerDelegate new
> uriSpace: (ZnCallHierarchyRestUriSpace new
> rootClass: ZnExampleSumRestCall;
> yourself);
> yourself).
>
>
>
>
> (ZnClient new) get: 'http://localhost:1700/appName?action=&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}'

Which works for me, sorry, it gives:

  a ZnResponse(404 Not Found text/plain;charset=utf-8 34B)

You still haven't said anything about which versions of Pharo/Zinc you are using, on which platform you are.

Sven

> Regards.
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ZnUnknownHttpVersion

lanvin.kevin
I've taken a new Pharo 3.0 image on pharo.org

Then I loaded Zinc-REST from your repository : http://smalltalkhub.com/#!/~SvenVanCaekenberghe/ZincHTTPComponents

I executed the code : 


| server |

server := ZnServer startOn: 1700 .

server delegate: 

(ZnRestServerDelegate new 

uriSpace: (ZnCallHierarchyRestUriSpace new 

rootClass: ZnExampleSumRestCall;

yourself); 

yourself).

(ZnClient new) get: 'http://localhost:1700/appName?action=&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}'


The error occured.

Is there something missing in my image ?


Thank you for your patience


> Message du 06/03/14 17:20

> De : "Sven Van Caekenberghe"
> A : [hidden email], "Seaside - general discussion"
> Copie à :
> Objet : Re: [Seaside] ZnUnknownHttpVersion
>
> Kevin,
>
> On 06 Mar 2014, at 16:55, [hidden email] wrote:
>
> > It's working on a seaside server, but not on a RestServer.
> > This code should show you the problem.
> >
> > | server |
> > server := ZnServer startOn: 1700 .
> > server delegate:
> > (ZnRestServerDelegate new
> > uriSpace: (ZnCallHierarchyRestUriSpace new
> > rootClass: ZnExampleSumRestCall;
> > yourself);
> > yourself).
> >
> >
> >
> >
> > (ZnClient new) get: 'http://localhost:1700/appName?action=&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}'
>
> Which works for me, sorry, it gives:
>
> a ZnResponse(404 Not Found text/plain;charset=utf-8 34B)
>
> You still haven't said anything about which versions of Pharo/Zinc you are using, on which platform you are.
>
> Sven
>
> > Regards.
> > _______________________________________________
> > seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ZnUnknownHttpVersion

Sven Van Caekenberghe-2

On 06 Mar 2014, at 17:49, [hidden email] wrote:

> I've taken a new Pharo 3.0 image on pharo.org
> Then I loaded Zinc-REST from your repository : http://smalltalkhub.com/#!/~SvenVanCaekenberghe/ZincHTTPComponents
> I executed the code :
>
> | server |
> server := ZnServer startOn: 1700 .
> server delegate:
> (ZnRestServerDelegate new
> uriSpace: (ZnCallHierarchyRestUriSpace new
> rootClass: ZnExampleSumRestCall;
> yourself);
> yourself).
> (ZnClient new) get: 'http://localhost:1700/appName?action=&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}'
>
> The error occured.
> Is there something missing in my image ?

How did you load Zinc-REST ? Manually or using the configuration group ? The proper way is:

  ConfigurationOfZincHTTPComponents project latestVersion load: 'REST'.

You might be missing NeoJSON.

> Thank you for your patience

No problem, just trying to help.

> > Message du 06/03/14 17:20
> > De : "Sven Van Caekenberghe"
> > A : [hidden email], "Seaside - general discussion"
> > Copie à :
> > Objet : Re: [Seaside] ZnUnknownHttpVersion
> >
> > Kevin,
> >
> > On 06 Mar 2014, at 16:55, [hidden email] wrote:
> >
> > > It's working on a seaside server, but not on a RestServer.
> > > This code should show you the problem.
> > >
> > > | server |
> > > server := ZnServer startOn: 1700 .
> > > server delegate:
> > > (ZnRestServerDelegate new
> > > uriSpace: (ZnCallHierarchyRestUriSpace new
> > > rootClass: ZnExampleSumRestCall;
> > > yourself);
> > > yourself).
> > >
> > >
> > >
> > >
> > > (ZnClient new) get: 'http://localhost:1700/appName?action=&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}'
> >
> > Which works for me, sorry, it gives:
> >
> > a ZnResponse(404 Not Found text/plain;charset=utf-8 34B)
> >
> > You still haven't said anything about which versions of Pharo/Zinc you are using, on which platform you are.
> >
> > Sven
> >
> > > Regards.
> > > _______________________________________________
> > > seaside mailing list
> > > [hidden email]
> > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ZnUnknownHttpVersion

lanvin.kevin

Hello ,


In my main image, I was using the wrong repository to get the configuration.
Now it works perfectly ! 
Thank you for your help.


Have a nice day.

> Message du 06/03/14 18:25

> De : "Sven Van Caekenberghe"
> A : [hidden email]
> Copie à : "Seaside - general discussion"
> Objet : Re: [Seaside] ZnUnknownHttpVersion
>
>
> On 06 Mar 2014, at 17:49, [hidden email] wrote:
>
> > I've taken a new Pharo 3.0 image on pharo.org
> > Then I loaded Zinc-REST from your repository : http://smalltalkhub.com/#!/~SvenVanCaekenberghe/ZincHTTPComponents
> > I executed the code :
> >
> > | server |
> > server := ZnServer startOn: 1700 .
> > server delegate:
> > (ZnRestServerDelegate new
> > uriSpace: (ZnCallHierarchyRestUriSpace new
> > rootClass: ZnExampleSumRestCall;
> > yourself);
> > yourself).
> > (ZnClient new) get: 'http://localhost:1700/appName?action=&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}'
> >
> > The error occured.
> > Is there something missing in my image ?
>
> How did you load Zinc-REST ? Manually or using the configuration group ? The proper way is:
>
> ConfigurationOfZincHTTPComponents project latestVersion load: 'REST'.
>
> You might be missing NeoJSON.
>
> > Thank you for your patience
>
> No problem, just trying to help.
>
> > > Message du 06/03/14 17:20
> > > De : "Sven Van Caekenberghe"
> > > A : [hidden email], "Seaside - general discussion"
> > > Copie à :
> > > Objet : Re: [Seaside] ZnUnknownHttpVersion
> > >
> > > Kevin,
> > >
> > > On 06 Mar 2014, at 16:55, [hidden email] wrote:
> > >
> > > > It's working on a seaside server, but not on a RestServer.
> > > > This code should show you the problem.
> > > >
> > > > | server |
> > > > server := ZnServer startOn: 1700 .
> > > > server delegate:
> > > > (ZnRestServerDelegate new
> > > > uriSpace: (ZnCallHierarchyRestUriSpace new
> > > > rootClass: ZnExampleSumRestCall;
> > > > yourself);
> > > > yourself).
> > > >
> > > >
> > > >
> > > >
> > > > (ZnClient new) get: 'http://localhost:1700/appName?action=&firstParameter=["Value"]&secondParameter=["Value"]&lastParameter={ "Key":["firstValue","secondValue"]}'
> > >
> > > Which works for me, sorry, it gives:
> > >
> > > a ZnResponse(404 Not Found text/plain;charset=utf-8 34B)
> > >
> > > You still haven't said anything about which versions of Pharo/Zinc you are using, on which platform you are.
> > >
> > > Sven
> > >
> > > > Regards.
> > > > _______________________________________________
> > > > seaside mailing list
> > > > [hidden email]
> > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> > >
> > >
> >
>
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside