On 02 Feb 06:30, urosh wrote: > Hello. > > I have a problem with content-length heater in HTTP-message. I am > writing application for voip phone, which is not always specified, > then the phone can't download xml file correctly (stupid, I gess). > > How can I correct this behaviour? > I tested this with wget tool. Here are results. > > Connecting to 192.168.1.248:80... connected. > [12] 18882 > HTTP request sent, awaiting response... [9] Done > wget http://192.168.1.248/pb.xml?peer=298 > [10] Done p=1 > u...@user-laptop:/tmp$ 200 OK > Length: 360 [text/xml] > Saving to: `pb.xml?peer=298.32' > > 100% > [===================================================================================================>] > 360 --.-K/s in 0s > > 2010-02-02 15:28:56 (20.6 MB/s) - `pb.xml?peer=298.32' saved [360/36 > > > HTTP request sent, awaiting response... [50] 18962 > [47] Done wget http://192.168.1.248/pb.xml?peer=298 > [48] Done p=1 > u...@user-laptop:/tmp$ 200 OK > Length: unspecified [text/xml] > Saving to: `pb.xml?peer=298.51' > > > [ <=> > ] > 360 --.-K/s in 0s > > 2010-02-02 15:29:35 (25.6 MB/s) - `pb.xml?peer=298.51' saved [360]
Erm, looks like you're missing a bit to the wget, is there (perchance) an &p=1... because that's what it looks like it should have so try: wget "http://192.168.1.248/pb.xml?peer=298&p=1" Note the "s... otherwise you end up running a wget and "p=1", which probably isn't what you wanted it to do. Are you saying that the phone can't read unless Content-length is set? You might be able to do that with some middleware, infact, it appears that you can just use the ConditionalGetMiddleware to add the Content-length header. http://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.http Hope that helps, -- Brett Parker -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.