Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Serving Embedded CSS and JS Files |
|
Author |
|
gw1500se
Joined: 03 Dec 2014 Posts: 4
|
Posted: Sat 16 May '20 18:39 Post subject: Serving Embedded CSS and JS Files |
|
|
I am trying write a script using python 3 httpd server. Unfortunately the documentation to that is very poor and the python forum has not been much help. Since my question is really about how data is send to the client I hope I can get some help here.
I have no trouble serving out the main page. The problem is how to serve out the embedded css and/or js files. I get the request for the files but I think my problem is I need to server them out with different headers than the main page. When the browser requests a css file, what does it expect to see as far as headers are concerned to know this is not a new page but rather the file requested? How do I know the difference between requests for a regular html page and a css or js page? It is just the file type? TIA. |
|
Back to top |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7104 Location: Germany, Next to Hamburg
|
Posted: Sun 17 May '20 17:55 Post subject: |
|
|
You may search for
Quote: | phython set http header content type | on the web.
The header for javascript files and css files is different than html |
|
Back to top |
|
gw1500se
Joined: 03 Dec 2014 Posts: 4
|
Posted: Sun 17 May '20 18:38 Post subject: |
|
|
Thanks for the reply. You put me on the right track. |
|
Back to top |
|
|
|
|
|
|