missing header content-type

62 views
Skip to first unread message

vincenzo giacchina

unread,
Jun 24, 2015, 6:43:15 AM6/24/15
to phan...@googlegroups.com
Hi,
When phantomjs response doesn't send header "Content-type" information. is this correct ? I wish it send this information also.
How can i do it ?

Gabe Misura

unread,
Jun 25, 2015, 2:20:44 PM6/25/15
to phan...@googlegroups.com
That would probably require knowing what each file's content type is. Apache does it with MIME.types, simply mapping file extension to a Content-Type.
So if you request a .html file, it will send the HTML content-type.  If you request an XML file, it will send that content-type by looking at the extension and looking at the MIME.types "mapping" (lookup table).

I'm guessing this is not implemented as PhantomJS is not meant to be a real web server, just a test. Doco says "Don't use in production".

David Henderson

unread,
Jun 26, 2015, 5:32:26 AM6/26/15
to phan...@googlegroups.com
Vincenzo,

Take a look at Peak's PR - it has an example that sends a content-type header:


David

--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phantomjs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/phantomjs.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages