简体   繁体   中英

Why HTTP response returns 2 codes

This is a django project, a very simple one indeed, i got a question about the response code of the HTTP header.

I am running it on localhost.

# URL Patterns in the Project folder.

urlpatterns = [
    path('blog/', include(blog.urls)),
]

# URL Patterns in the blog folder.
urlpatterns = [
    path('index/', blog.views.index, name='blog_index'),
    path('about/', blog.views.about, name='blog_about')
]

Everything runs fine but the shell response is:

[21/Aug/2019 21:15:54] "GET /blog/index/ HTTP/1.1" 200 144

The question is about the HTTP Header response 200 144

After playing with urllib a bit i used to think that headers send only 1 response code 200 OK

For some reason django sends 2 codes

200 OK
144 Corresponds with HTTP 404.
# Reference https://developer.twitter.com/en/docs/basics/response-codes.html 

144 is not a status code, it's the size of the response.

The error codes reference you found has nothing to do HTTP status codes in general or with your Django project. These are error codes used solely by Twitter API. You finding it in a google search is merely coincidental.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM