我注意到chrome缓存了一个视频文件.我用服务器上的另一个替换它,并且chrome继续从缓存服务旧的(使用JW flash player 5)
请求的标头如下所示:
joe@joe-desktop:~$ wget -O - -S --spider http://www.2xfun.de/files_geheimhihi14/20759.mp4
Spider mode enabled. Check if remote file exists.
--2011-05-15 22:40:56-- http://www.2xfun.de/files_geheimhihi14/20759.mp4
Resolving www.2xfun.de... 213.239.214.112
Connecting to www.2xfun.de|213.239.214.112|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Sun, 15 May 2011 20:40:56 GMT
Server: Apache
Last-Modified: Sun, 15 May 2011 20:37:59 GMT
ETag: "89b38-3bb227-4a35683b477c0"
Accept-Ranges: bytes
Content-Length: 3912231
Cache-Control: max-age=29030400, public, must-revalidate
Expires: Sun, 15 Apr 2012 20:40:56 GMT
Connection: close
Content-Type: video/mp4
Length: 3912231 (3.7M) [video/mp4]
Remote …Run Code Online (Sandbox Code Playgroud) 我们想象那种形式;
<form action="http://api.blabla.com/huhu.php" method="post" enctype="multipart/form-data">
<input type="file" name="files[]" />
<button type="submit">submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)
我想在不使用上面的表单的情况下将文件上传到此服务器.
我用php curl尝试了这个,但我不能.
我想要它,因为我要上传大量文件.这应该是cron工作的自动化.
我正在编写一个用于教育目的的超小型Web服务器.
对于以下代码,如果我请求包含图像的html页面,我无法在浏览器中看到该图像.我究竟做错了什么?
static void Main(string[] args)
{
TcpListener listener = new TcpListener(9999);
listener.Start();
while (true)
{
TcpClient client = listener.AcceptTcpClient();
string request = GetRequest(client.GetStream(),
client.ReceiveBufferSize);
WriteOutput(request, client.GetStream());
client.Close();
}
}
static void WriteOutput(string request, NetworkStream output)
{
try
{
string[] reqs = request.Split(' ');
WriteOutputHelper(output, reqs[1].Substring(1));
}
catch (Exception)
{
WriteOutputHelper(output, "404.html");
}
}
private static void WriteOutputHelper(NetworkStream output, string file)
{
byte[] statusLine = (new System.Text.ASCIIEncoding()).
GetBytes(GetStatusLine(file) + "\r\n\r\n");
output.Write(statusLine, 0, statusLine.Length);
byte[] ContentType =
(new System.Text.ASCIIEncoding()).GetBytes(GetContentType(file) +
"\r\n\r\n"); …Run Code Online (Sandbox Code Playgroud) 我$.ajax必须设置哪些参数来尝试将AJAX请求作为正常请求进行掩码?我想这与正确的标题有关.
我认为问题的一个重要部分是当处理本地.html文件时,jQuery将header-value设置为Originto null.
有没有办法取出Origin-header?
在这一刻,如果我通过网络浏览器浏览它并且当我执行jQuery AJAX请求时,我会从同一个URL获得不同的结果.
我有一个C#WCF服务,它接收请求消息并将其发布到另一个服务.发布到其他服务是通过HttpWebRequest完成的.当我将它们发布到其他服务时,如何在我的服务中获取原始请求HTTP标头并将它们放入HttpWebRequest中.
像这样的东西:
HttpRequestMessageProperty httpRequestProp = GetHttpRequestProp(requestMessage);
HttpWebRequest loHttp = (HttpWebRequest)WebRequest.Create(uri);
foreach (var item in httpRequestProp.Headers.AllKeys)
{
loHttp.Headers.Add(item, httpRequestProp.Headers[item]);
}
Run Code Online (Sandbox Code Playgroud)
我知道这不起作用,因为HttpWebRequest loHttp有自己的属性,当我尝试以上述方式设置ContentType时它抛出异常,因为它需要像这样设置:
loHttp.ContentType = httpRequestProp.Headers[HttpRequestHeader.ContentType];
Run Code Online (Sandbox Code Playgroud)
那么有没有办法从调用中复制HTTP请求标头并将它们作为HTTP请求标头放到另一个HttpWebRequest?此外,原始请求可能还设置了其他自定义标头,我也希望将这些标头也发送到其他服务.
谢谢Adrya
我正在建立一个HttpGet网址,我不希望服务器发送数据gzipped.我header应该包括哪些内容HttpGet?
使用默认标头,服务器会不时发送gzip压缩数据.我不希望这种情况发生.谢谢.
我的服务是通过IIS中的基本身份验证设置保护的,我尝试使用Jquery从服务获取数据.
已启用跨域调用.
我有下一个请求标题
Host http:\\service.com
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-gb,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection keep-alive
Origin null
Access-Control-Request-Me... GET
Access-Control-Request-He... authorization
Pragma no-cache
Cache-Control no-cache
Run Code Online (Sandbox Code Playgroud)
回应
Content-Type text/html
Server Microsoft-IIS/7.5
WWW-Authenticate Basic realm="172.27.131.5"
X-Powered-By ASP.NET
Access-Control-Allow-Orig... *
Access-Control-Allow-Head... *
Date Fri, 12 Aug 2011 08:07:29 GMT
Content-Length 1293
Run Code Online (Sandbox Code Playgroud)
码
$.ajax({
headers : {
"Authorization" : "Basic TVNF3TQtU1BGMjAx6C12bVxzbW4ydHBvaW50OlF3Z5J0eSEyM6Q1"
},
type: "GET",
url: url,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
alert('ok!'); …Run Code Online (Sandbox Code Playgroud) 当某些条件满足时,我想向用户发送"403 Forbidden"HTTP状态代码,但我在typoscript中找不到任何修改HTTP头的可能性.我错过了什么,或者这是不可能的typoscript?
我正在使用Typo3 4.5.6.
headers_list()并apache_reponse_headers()返回实际响应头的大大降低列表,即使在headers_sent()与get_headers()将使另一个HTTP请求.
那么,如何获得与当前页面一起发送的响应头的完整列表,或者这些额外的响应头(由服务器设置)仅在PHP完成后设置很久?
是否可以使用apache .htaccess基于URL的查询字符串应用HTTP头指令?
例如,根据此资源http://code.google.com/web/controlcrawlindex/docs/robots_meta_tag.html标题为"实际实施X-Robots-Tag with Apache"一节,它说明了以下.htaccess文件指令可以使用:
<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</Files>
Run Code Online (Sandbox Code Playgroud)
我正在寻找以下内容:
<QueryString ~ "m=_!">
Header set X-Robots-Tag "noindex, nofollow"
</QueryString>
Run Code Online (Sandbox Code Playgroud)
这样,搜索引擎就不会将以下网址编入索引:
http://domain.com/?m=_!ajax_html_snippet
Run Code Online (Sandbox Code Playgroud)
任何提示/提示/线索将非常感激.谢谢.
http-headers ×10
http ×4
ajax ×2
c# ×2
jquery ×2
php ×2
wcf ×2
.htaccess ×1
android ×1
apache ×1
apache2 ×1
curl ×1
file-upload ×1
html ×1
httpresponse ×1
java ×1
nofollow ×1
noindex ×1
query-string ×1
typo3 ×1
typoscript ×1