On Feb 7, 2011, at 10:02 AM, Gabriel Carmona wrote:
> 
> I'm using "Version 1.91.6 (2011-01-03 17:55:14)"

Thanks. I've got a working patch that hopefully we'll have time to get into 
1.92.

In the current version, you'll need to avoid rewrites that add a query string; 
that's broken.

> 
> On Mon, Feb 7, 2011 at 2:50 PM, Jonathan Lundell <[email protected]> wrote:
>> On Feb 7, 2011, at 8:49 AM, Gabriel Carmona wrote:
>>> 
>>> Hi Jonathan. It was a typo. It'd be service instead of app:
>>> 
>>> curl --data-urlencode 'fields={"name": "test"}'
>>> "http://localhost:8000/service/person/create";
>>> 
>>> Thanks anyway.
>> 
>> The URL rewrite logic isn't handling the case of appending a query string to 
>> the incoming URL properly.
>> 
>> I'm checking to see if this was broken recently, or if it's been broken for 
>> a while. What version are you running?
>> 
>> 
>>> 
>>> On Mon, Feb 7, 2011 at 1:21 PM, Jonathan Lundell <[email protected]> wrote:
>>>> On Feb 6, 2011, at 4:47 PM, Gabriel wrote:
>>>>> 
>>>>> Hi, I have this json service:
>>>>> 
>>>>> app/default.py
>>>>> ...
>>>>> @service.json
>>>>> def create(model, fields):
>>>>>  return dict(id=get_model_or_404(model).insert(**json.loads(fields)))
>>>>> 
>>>>> and I am trying to map this:
>>>>> 
>>>>> routes_in = (
>>>>>  ('/service/$model/create', '/app/default/call/json/create?model=
>>>>> $model'),
>>>>> )
>>>>> 
>>>>> With this I'd want to do:
>>>>> 
>>>>> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:8000/
>>>>> app/person/create"
>>>>> 
>>>>> and in the create function get model="person" and in fields='{"name":
>>>>> "test"}'
>>>>> But it does not work, it is redirecting to default page.
>>>>> In httpserver.log I get
>>>>> 
>>>>> 127.0.0.1, 2011-02-06 20:41:12, POST, , HTTP/1.1, 200, 0.330055
>>>>> 
>>>>> If I do:
>>>>> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:
>>>>> 8000/app/default/call/json/create?model=person"
>>>>> it works, so I think the problem is the routing.
>>>>> 
>>>>> Any help about what I'm doing wrong?
>>>> 
>>>> Is it as simple as 'app' in your incoming URL not matching 'service' in 
>>>> the routes pattern?
>>>> 
>>>> 
>>>>> Thanks for advance.
>>>> 
>>>> 
>>>> 
>> 
>> 
>> 


Reply via email to