xmlhttprequest

XMLHTTPRequest状态status完整列表

半城伤御伤魂 提交于 2020-01-11 23:38:58
XMLHTTPRequest状态status完整列表 AJAX中请求远端文件、或在检测远端文件是否掉链时,都需要了解到远端服务器反馈的状态以确定文件的存在 与否。 当然,在我们平常浏览网页时,也会发现一些文件不存在时显示为“404错误”,这就是常见的Http请求状态(status)   Web服务器响应浏览器或其他 客户 程序的请求时,其应答一般由以下几个部分组成:一个状态行,几个应答头,一个空行,内容文档。下面是一个最 简单 的应答:   状态行包含HTTP版本、状态代码、与状态代码对应的简短说明信息。在大多数情况下,除了Content-Type之外的所有应答头都是可选的。但Content-Type是必需的,它描述的是后面文档的MIME类型。虽然大多数应答都包含一个文档,但也有一些不包含,例如对HEAD请求的应答永远不会附带文档。有许多状态代码实际上用来标识一次失败的请求,这些应答也不包含文档(或只包含一个简短的错误信息说明)。   当用户试图通过 HTTP 访问一台正在运行 Internet 信息服务 (IIS) 的服务器上的内容时,IIS 返回一个表示该请求的状态的数字代码。状态代码可以指明具体请求是否已成功,还可以揭示请求失败的确切原因。 1xx - 信息提示 这些状态代码表示临时的响应。客户端在收到常规响应之前,应准备接收一个或多个 1xx 响应。 ·0 - 本地响应成功

AJAX and Client-Server Architecture with JavaScript

旧时模样 提交于 2020-01-11 19:59:22
问题 I have to program websites, but I rather don't like the static HTML nature. I prefer more of a client-server architecture. Now I've figured, that with XMLhttp, you can basically dynamically update your page and send/request for information/action to/from a server. So this would basically cover the client area. But to complete a client-server architecture, it is necessary for the server to send/request information, too, without being queried. Is there any way, for example for a chat server, to

AJAX and Client-Server Architecture with JavaScript

本秂侑毒 提交于 2020-01-11 19:56:00
问题 I have to program websites, but I rather don't like the static HTML nature. I prefer more of a client-server architecture. Now I've figured, that with XMLhttp, you can basically dynamically update your page and send/request for information/action to/from a server. So this would basically cover the client area. But to complete a client-server architecture, it is necessary for the server to send/request information, too, without being queried. Is there any way, for example for a chat server, to

Facebook xhr login: Cross-Origin Request Blocked

☆樱花仙子☆ 提交于 2020-01-11 14:29:29
问题 I have this problem, when I try to log in users on my website through facebook using XHR my request gets blocked, however if I copy the URL of the XHR request and paste it in the browser I get logged in. So here's a simple schematic: Why is xhr getting blocked on the same url a browser can access? 回答1: Why is xhr getting blocked on the same url a browser can access? Because it is a cross-domain request, and as such the remote party would have to allow that request first, which is what is

Facebook xhr login: Cross-Origin Request Blocked

℡╲_俬逩灬. 提交于 2020-01-11 14:29:07
问题 I have this problem, when I try to log in users on my website through facebook using XHR my request gets blocked, however if I copy the URL of the XHR request and paste it in the browser I get logged in. So here's a simple schematic: Why is xhr getting blocked on the same url a browser can access? 回答1: Why is xhr getting blocked on the same url a browser can access? Because it is a cross-domain request, and as such the remote party would have to allow that request first, which is what is

No 'Access-Control-Allow-Origin' header when receiving JSON data from server

六眼飞鱼酱① 提交于 2020-01-11 14:12:23
问题 I am trying to make the client side receiving JSON data from the Server, however, it constantly popped up the error method. When I try to use Chrome to debug, it popped up: XMLHttpRequest cannot load http://localhost:8080/TransportationNetwork/rest/paths?st=3,6. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. I have tried to change dataType to 'jsonp', but it doesn't work. However, when I use POSTMAN to test the data

VBA xmlhttprequest loop without closing connection

廉价感情. 提交于 2020-01-11 11:55:08
问题 I am connecting to an API using xmlhttp in VBA. The problem is that I need to create a loop multiple times using the same API link with the only difference that I send different JSON string. Is it possible to open the connection and send headers and authentification only once then send data and receive response multiple times? The main purpose is to improve the speed of the code. I am aware that I can send header and authenticate inside the loop but it runs too slow for my needs. Thank you!

DELETE Request with Payload or Form Data causes Bad Request

送分小仙女□ 提交于 2020-01-11 10:25:11
问题 I am building a RESTful Web Service with Java Jersey 2.17. The Client for it. I am developing with ExtJS 5. My classes on the service Main.java public class Main { public static final String BASE_URI = "http://localhost:8080/app/rest/"; public static HttpServer startServer() { final ResourceConfig rc = new ResourceConfig(); rc.packages(true, "app"); rc.register(ResponseCorsFilter.class); return GrizzlyHttpServerFactory.createHttpServer(URI.create(Main.BASE_URI), rc); } public static void main

Firefox XHR not firing upload progress events

别等时光非礼了梦想. 提交于 2020-01-11 07:44:12
问题 Pretty straight-forward HTML/JS that: Takes a Base64-encoded PNG Converts it to a blob Sets an img.src to verify that it's a valid PNG Uploads it via XHR after setting event handlers In Firefox 12 I get the " loadstart " and " loadend " events but no " progress " events. In Chrome 20 everything works fine. This file is named "image.html" so it just uploads to itself for testing. I also tried setting a content-legnth header but that didn't change the results in Firefox so I commented it out.

jquery getResponseHeader always returns 'undefined'?

拟墨画扇 提交于 2020-01-11 04:23:05
问题 I have a a form that I am submitting via ajax. I am using the jquery form plugin. What I am trying to do is get the 'Location' header which is returned from my server. I can see it in firebug. But whenever I call the getResponseHeader() function in my success callback, it always returns 'undefined'.. Code: form.ajaxForm({ dataType: 'xml', data: {format: 'xml'}, resetForm: true, success: function(xml,status,xhr){ var location = xhr.getResponseHeader('Location'); alert(location); }); location