Skip to content

Custom headers #31

Description

@ShayanArifButt

how to add custom header ?

this is custom header option:
http://phantomjs.org/api/webpage/property/custom-headers.html

but in where should i add this ? i itried to add in "PJCtrl.js" file , but then my php script kept on loading infinitely. I tried to add like this in "PJCtrl.js" file

`function configurePage(windowObj)
{
try {

	if (typeof windowObj.pjsPage == 'undefined') {
		windowObj.pjsPage			= webpage.create();
		
		windowObj.pjsPage.customHeaders = {
			"Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
			"Accept-Language:en-US,en;q=0.8",
			"Connection:keep-alive",
			"User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36"
		};
		
	}`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions