Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Networking UnityWebRequest should expose the full HTTP response status

Discussion in '5.4 Beta' started by MV10, May 24, 2016.

  1. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    Currently UnityWebRequest only exposes the numeric status code from an HTTP response via the responseCode property.

    Typically the first line of an HTTP response (called the Initial Response Line or Status Line) has three parts, the HTTP version, the status code, and a text description. For example:

    HTTP/1.1 400 Invalid request.

    I am requesting either access to the full Status Line, or access to the status description. The description often contains useful details which can be helpful debugging web-based services.

    I posted this as a Feedback item here in case it doesn't make the cut in 5.4 or the devs aren't convinced of the value, but I've been building and using REST for many years and I was pretty surprised this information is just discarded.

    For example, in my own project I accidentally coded a call to "GetFriendList" instead of the correct plural-form "GetFriendsList" and the useful but unavailable Status Line was:

    HTTP/1.1 400 "Account/GetFriendList" is not a valid request.
     
    ted537 likes this.