Pesquisar no apoio

Evite burlas no apoio. Nunca iremos solicitar que telefone ou envie uma mensagem de texto para um número de telefone ou que partilhe informações pessoais. Por favor, reporte atividades suspeitas utilizando a opção "Reportar abuso".

Saber mais

Cross-domain POST XMLHTTPrequest with CORS throws Error loading content (NS_ERROR_DOCUMENT_NOT_CACHED).How to fix this in Firefox 28.0?

  • 1 resposta
  • 2 têm este problema
  • 10 visualizações
  • Última resposta por guigs

more options

I cannot do POST XMLHTTPrequest with CORS. GET request is ok, but my POST request throws Error loading content (NS_ERROR_DOCUMENT_NOT_CACHED) as HTTPfox says. I send just a string like "helloworld" and so there should be no content-type problems.

Request Header:

(Request-Line)	GET /receive-data.php HTTP/1.1
Host --------myhost-------------
User-Agent	Mozilla/5.0 (X11; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0
Accept	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language	en-US,en;q=0.5
Accept-Encoding	gzip, deflate
Connection	keep-alive
Cache-Control	max-age=0
Pragma  no-cache
Cache-Control no cache

Response Header:

(Status-Line)	HTTP/1.1 200 OK
Date	Tue, 15 Apr 2014 19:06:39 GMT
Server	Apache
X-Powered-By	PHP/5.2.17
Access-Control-Allow-Origin	*
Access-Control-Allow-Methods	OPTIONS, GET, POST, PUT
Keep-Alive	timeout=5, max=100
Connection	Keep-Alive
Transfer-Encoding	chunked
Content-Type	text/html
I cannot do POST XMLHTTPrequest with CORS. GET request is ok, but my POST request throws Error loading content (NS_ERROR_DOCUMENT_NOT_CACHED) as HTTPfox says. I send just a string like "helloworld" and so there should be no content-type problems. Request Header: <pre><nowiki>(Request-Line) GET /receive-data.php HTTP/1.1 Host --------myhost------------- User-Agent Mozilla/5.0 (X11; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0 Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Connection keep-alive Cache-Control max-age=0 Pragma no-cache Cache-Control no cache</nowiki></pre> Response Header: <pre><nowiki>(Status-Line) HTTP/1.1 200 OK Date Tue, 15 Apr 2014 19:06:39 GMT Server Apache X-Powered-By PHP/5.2.17 Access-Control-Allow-Origin * Access-Control-Allow-Methods OPTIONS, GET, POST, PUT Keep-Alive timeout=5, max=100 Connection Keep-Alive Transfer-Encoding chunked Content-Type text/html</nowiki></pre>

Modificado por cor-el a

Todas as respostas (1)

more options

Cache-Control max-age=0 ? If you change that value in a header editor, does the error still occur?

I think this add on allows you to do this? https://addons.mozilla.org/en-US/fire.../?src=search