.NET Components for Mobility

bad Request

Last post 01-13-2008 11:57 PM by ikex. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-12-2008 12:50 PM

    • ikex
    • Top 500 Contributor
    • Joined on 01-12-2008
    • Posts 2

    bad Request

    sorry im a bit new to all this, but if anyone  could help me that would be great.
    im trying to send a file from a c# console app to my nokia phone using the ObexObjectPush
    but i seem to keep getting Badrequest


                         Uri uri = new Uri("obex://" + addr + "/" + System.IO.Path.GetFileName(loc));
                        Console.WriteLine("[*} Uri: "+ uri.ToString());
                        ObexWebRequest request = new ObexWebRequest(uri);
                       // request.Method = "GET";
                        request.ContentType = MediaTypeNames.Image.Jpg;
                        request.ReadFile(loc);

                        ObexWebResponse response = (ObexWebResponse)request.GetResponse();
                        Console.WriteLine("
  • Got Response: "+response.StatusCode.ToString());
                        response.Close();

  • and in the console it says:

    Select a device # to connect to:1

  • Connecting to IKE (001BAF8A8449)
  • [*} Uri: obex://001baf8a8449/test.jpg
  • Got Response: BadRequest

     

    any help would be great.

    ikex 

  • Filed under:
  • 01-13-2008 9:32 AM In reply to

    Re: bad Request

    Status code BadRequest is used locally when the connect phase of the operation fails.  For diagnostic use at least, change to using ObexWebRequest2 and then you'll likely see an exception.

    What version are you using.  There was a bug fixed in 2.2 which might be this one...

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 01-13-2008 11:57 PM In reply to

    • ikex
    • Top 500 Contributor
    • Joined on 01-12-2008
    • Posts 2

    Re: bad Request

    indeed, i was using 2.1 after updating the problem seems to be gone

    thanks heaps Smile 

Page 1 of 1 (3 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.