File updload in post form in VBS

You are trying to upload binary file content as base64 encoded text, so it’s necessary to specify the appropriate MIME header, here is the fixed snippet of your code: request = request & sBoundary & vbCrLf request = request & “Content-Disposition: form-data; name=file; filename=” & sFile & vbCrLf request = request & “Content-Type: application/x-object” & … Read more

How to perform an HTTP POST request in ASP?

You can try something like this: Set ServerXmlHttp = Server.CreateObject(“MSXML2.ServerXMLHTTP.6.0”) ServerXmlHttp.open “POST”, “http://www.example.com/page.asp” ServerXmlHttp.setRequestHeader “Content-Type”, “application/x-www-form-urlencoded” ServerXmlHttp.setRequestHeader “Content-Length”, Len(PostData) ServerXmlHttp.send PostData If ServerXmlHttp.status = 200 Then TextResponse = ServerXmlHttp.responseText XMLResponse = ServerXmlHttp.responseXML StreamResponse = ServerXmlHttp.responseStream Else ‘ Handle missing response or other errors here End If Set ServerXmlHttp = Nothing where PostData is the data … Read more

HTTP Headers: Controlling Cache and History Mechanism

I’ll answer my own question: Static public content Date: <current time> Expires: <current time + one year> Rationale: This is compatible with the HTTP/1.0 proxies and RFC 2616 Section 14: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 The Last-Modified header is not needed for correct caching (because conforming user agents follow the Expires header) but may be included for the end … Read more

How does url rewrite works?

There are two types of behaviour. One is rewrite, the other is redirect. Rewrite The server performs the substitution for itself, making a URL like http://example.org/my/beatuful/page be understood as http://example.org/index.php?page=my-beautiful-page With rewrite, the client does not see anything and redirection is internal only. No URL changes in the browser, just the server understands it differently. … Read more

Why does Firebug show a “206 Partial Content” response on a video loading request?

This Partial Content code (206) may be sent from the server when the client has asked for a range (e.g. “give me the first 2MB of video data”). It is vital for downloading data in chunks which avoids fetching unused resources. (I seldom watch a full video online.) Look at the outgoing request for a … Read more

AngularJS factory http returns empty

You should modify your code to return a promise and use the value in controller pls see dummy modified code myDemo.factory(‘photosFactory’, function($http) { return{ getPhotos : function() { return $http({ url: ‘content/test_data.json’, method: ‘GET’ }) } } }); and controller – controllers.AppCtrl = function($scope, $location, $http, photosFactory) { $scope.photos = []; photosFactory.getPhotos().success(function(data){ $scope.photos=data; }); };

Is it possible to set more than one cookie with a single Set-Cookie?

The original cookie specification of Netscape (see this cached version) does not say anything about listing multiple cookie declarations. But as of Set-Cookie as defined by RFC 2109 allows a comma separated list of cookie declaration: Informally, the Set-Cookie response header comprises the token Set-Cookie:, followed by a comma-separated list of one or more cookies. … Read more