tagged [http]

Chrome dev tools fails to show response even the content returned has header Content-Type:text/html; charset=UTF-8

Chrome dev tools fails to show response even the content returned has header Content-Type:text/html; charset=UTF-8 Why does my Chrome developer tools show > Failed to show response data in response wh...

System.Web.Mvc.HttpPostAttribute vs System.Web.Http.HttpPostAttribute?

System.Web.Mvc.HttpPostAttribute vs System.Web.Http.HttpPostAttribute? In my Web API project which is based on the ASP.NET MVC, I want to use the `HttpPost` attribute. When I've added that onto the ac...

AngularJs ReferenceError: $http is not defined

AngularJs ReferenceError: $http is not defined I have the following Angular function: But whenever this function is called, I am getting `ReferenceError: $http is not defined` in my console. Can someo...

Invalid URI: The Authority/Host could not be parsed from very long url

Invalid URI: The Authority/Host could not be parsed from very long url This is the actual url to a Youtube video, at this moment if you copy to your chrome browser you may watch the video. But when I ...

11 Feb at 12:24

How do I force files to open in the browser instead of downloading (PDF)?

How do I force files to open in the browser instead of downloading (PDF)? Is there a way to force PDF files to open in the browser when the option "Display PDF in browser" is unchecked? I tried using ...

Laravel - Return json along with http status code

Laravel - Return json along with http status code If I return an object: the status code will be 200. How can I change it to 201, with a message and send it with the json object?. I don't know if ther...

30 Jun at 06:35

How to manually send HTTP POST requests from Firefox or Chrome browser

How to manually send HTTP POST requests from Firefox or Chrome browser I want to test some URLs in a web application I'm working on. For that I would like to manually create HTTP POST requests (meanin...

Getting form data from HttpListenerRequest

Getting form data from HttpListenerRequest I have a HttpListenerRequest which was initiated from a html `` that was posted. I need to know how to get the posted form values + the uploaded files. Does ...

Passing credentials to service stack rest api through angularJs and $http.get

Passing credentials to service stack rest api through angularJs and $http.get I have a service stack web service with the CorsFeature enabled. I am calling a service through AngularJS's $http.get meth...

ServiceStack Http Utils Set Cookie

ServiceStack Http Utils Set Cookie I am trying to use ServiceStacks Http Utils, but for some reason I can't seem to be able to set the JSession cookie I received from logging in via basic auth. This i...

22 Dec at 00:3

How do I make HttpURLConnection use a proxy?

How do I make HttpURLConnection use a proxy? If I do this... it prints The problem is, I am behind a proxy. Where does the JVM get its proxy information from on Windows? How do I set this up? All my o...

16 Sep at 13:28

SOAP object over HTTP post in C# .NET

SOAP object over HTTP post in C# .NET I am trying to compose a SOAP message(including header) in C# .NET to send to a URL using HTTP post. The URL I want to send it to is not a web-service, it just re...

25 Nov at 18:27

How to get the previous url using PHP

How to get the previous url using PHP Suppose my site's url is given as hyperlink on some page on the internet; that page could be anything on internet - blog, orkut, yahoo, even stackoverflow etc, an...

11 Aug at 13:15

get client time zone from browser

get client time zone from browser Is there a reliable way to get a timezone from client browser? I saw the following links but I want a more robust solution. [Auto detect a time zone with JavaScript](...

1 Mar at 21:27

How do I set headers using python's urllib?

How do I set headers using python's urllib? I am pretty new to python's urllib. What I need to do is set a custom header for the request being sent to the server. Specifically, I need to set the Conte...

28 Oct at 18:39

Generic htaccess redirect www to non-www

Generic htaccess redirect www to non-www I would like to redirect `www.example.com` to `example.com`. The following htaccess code makes this happen: But, is there a way to do this in a generic fashion...

How to write a server for an iPhone app

How to write a server for an iPhone app I'm writing a very simple iPhone app, basically a dropbox where people can submit ideas and then view what's in the dropbox. I need to write a server that will ...

11 Jan at 12:30

Service Stack Kill a HTTP request in filter

Service Stack Kill a HTTP request in filter Is there a way to kill an HTTPRequest inside of a filter. I the following code: ``` this.RequestFilters.Add((req, res, requestDto) => { var access...

11 Apr at 06:48

Canonical HTTP POST code?

Canonical HTTP POST code? I've seen so many implementations of sending an http post, and admittedly I don't fully understand the underlying details to know what's required. I want a generic method lik...

19 Feb at 01:54

Post comments on a WordPress page from Android application

Post comments on a WordPress page from Android application I need to post some text to a remote server over HTTP, this server in turn puts these comment on a Wordpress page. I am still waiting for int...

18 Mar at 09:6

How to print all information from an HTTP request to the screen, in PHP

How to print all information from an HTTP request to the screen, in PHP I need some PHP code that does a dump of all the information in an HTTP request, including headers and the contents of any infor...

28 Jun at 21:25

Service Stack Intercept All Http To Service

Service Stack Intercept All Http To Service Is there a way to intercept all http requests that hit your services? Example: request for `http://host/Account/Create` get captured at a single place and r...

12 Nov at 04:32

Request.Url.GetLeftPart(UriPartial.Authority) returns http on https site

Request.Url.GetLeftPart(UriPartial.Authority) returns http on https site We use `Request.Url.GetLeftPart(UriPartial.Authority)` to get the domain part of the site. This served our requirement on http....

3 Jun at 06:45

Is an HTTP PUT request required to include a body?

Is an HTTP PUT request required to include a body? I'm having trouble finding a definite specification of this in the standard. I have an HTTP client that's not including a `Content-Length: 0` header ...

7 Nov at 14:35

Share cookies between subdomain and domain

Share cookies between subdomain and domain I have two questions. I understand that if I specify the domain as `.example.com` (with the leading dot) in the cookie that all subdomains can share a cookie...

8 Dec at 21:45

HttpClient retrieve all headers

HttpClient retrieve all headers Currently, I am working on API wrapper. If I send a bad `Consumer Key`, the server will return `Status` as `403 Forbidden` in the header. It will also pass custom heade...

What is the difference between URI, URL and URN?

What is the difference between URI, URL and URN? What's the difference between an URI, URL and URN? I have read a lot of sites (even Wikipedia) but I don't understand it. URI: [http://www.foo.com/bar....

6 Feb at 12:48

URL format with GET parameters?

URL format with GET parameters? Is there a specification somewhere listing the correct way to pass GET variables to a URL? Normally I do it like this (first variable indicated by ?, second and subsequ...

13 May at 22:35

What is the usefulness of PUT and DELETE HTTP request methods?

What is the usefulness of PUT and DELETE HTTP request methods? I've never used PUT or DELETE HTTP Request methods. My tendency is to use GET when the state of the system (my application or website) ma...

11 Nov at 15:37

System.Web.Http missing in .net Core 2.1

System.Web.Http missing in .net Core 2.1 System.Web.Http is missing in my .net core 2.1 project. the error states > Error CS0234 The type or namespace name 'Http' does not exist in the namespace 'Syst...

What should a Multipart HTTP request with multiple files look like?

What should a Multipart HTTP request with multiple files look like? I'm working on an iPhone app that makes a multipart HTTP request with multiple image files. It looks like what's happening, on the s...

27 May at 02:3

Detect/estimate country of a http-request in ASP.NET

Detect/estimate country of a http-request in ASP.NET I'm looking for ways to detect/estimate the from which a is coming in . I know there are some solutions with services/country lookups but I never u...

17 Aug at 12:33

Maximum length of HTTP GET request

Maximum length of HTTP GET request What's the maximum length of an HTTP [GET](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods) request? Is there a response error defined that...

22 Jan at 23:34

HTTP POST using JSON in Java

HTTP POST using JSON in Java I would like to make a simple HTTP POST using JSON in Java. Let's say the URL is `www.site.com` and it takes in the value `{"name":"myname","age":"20"}` labeled as `'detai...

16 Oct at 06:6

HTTP response header, format for "Expires"

HTTP response header, format for "Expires" I am setting this in C# with this line: Now I know the format is off on this as it expects the following: Tue, 06 Dec 2011 20:24:15 GMT Is there a class in ....

23 Jan at 20:59

Difference between application/x-javascript and text/javascript content types

Difference between application/x-javascript and text/javascript content types What is the difference between these headers? Which one is best and why? Please do not say they are identical - if they we...

16 Jan at 23:33

HttpStatusCode is any 500 type

HttpStatusCode is any 500 type I was wondering if there was an easier way (nicer way) to check for a 500 status code? The only way I can think of doing this is by doing: ``` var statusCodes = new List...

10 May at 11:51

Difference between Request.Form and Request.QueryString?

Difference between Request.Form and Request.QueryString? Can some tell me the exact difference between `Request.Form` and `Request.QueryString`? I know one difference, like > If the HTTP request metho...

Customize OWIN/OAuth HTTP status code when rejecting a token request

Customize OWIN/OAuth HTTP status code when rejecting a token request I've derived [OAuthAuthorizationServerProvider](https://msdn.microsoft.com/en-us/library/microsoft.owin.security.oauth.oauthauthori...

13 May at 18:47

How to post form-data IFormFile with HttpClient?

How to post form-data IFormFile with HttpClient? I have backend endpoint `Task Post(IFormFile csvFile)` and I need to call this endpoint from HttpClient. Currently I am getting `Unsupported media type...

Content-Disposition:What are the differences between "inline" and "attachment"?

Content-Disposition:What are the differences between "inline" and "attachment"? What are the differences between and I don't know the differences , because when I use one or another I always get a win...

22 Mar at 15:10

C# method to do URL encoding?

C# method to do URL encoding? what c# class method can I use to URL encode a URL string? In my use case I want to pass a URL string as a URL parameter itself. So like burying a URL within a URL. Witho...

1 Oct at 22:36

How can I get all the request headers in Django?

How can I get all the request headers in Django? I need to get all the Django request headers. From what I've read, Django simply dumps everything into the `request.META` variable along with a lot of ...

How to prevent http file caching in Apache httpd (MAMP)

How to prevent http file caching in Apache httpd (MAMP) I am developing a single page Javascript application in MAMP. My JavaScript and HTML template files are getting cached between requests. Is ther...

24 Nov at 16:20

How can I select and upload multiple files with HTML and PHP, using HTTP POST?

How can I select and upload multiple files with HTML and PHP, using HTTP POST? I have experience doing this with single file uploads using ``. However, I am having trouble doing uploading more than on...

8 Jun at 08:18

Disabled form inputs do not appear in the request

Disabled form inputs do not appear in the request I have some disabled inputs in a form and I want to send them to a server, but Chrome excludes them from the request. Is there any workaround for this...

7 Jul at 12:35

Asp.net Web Api set response status code to number

Asp.net Web Api set response status code to number In Asp.net Web Api, how do I set the status code of my response using an int or string, not the StatusCode enum? In my case, I'd like to return vali...

19 Oct at 19:56

HTTP Request in Swift with POST method

HTTP Request in Swift with POST method I'm trying to run a HTTP Request in Swift, to POST 2 parameters to a URL. Example: Link: `www.thisismylink.com/postName.php` Params: What is the simplest way to ...

Problem HTTP error 403 in Python 3 Web Scraping

Problem HTTP error 403 in Python 3 Web Scraping I was trying to a website for practice, but I kept on getting the HTTP Error 403 (does it think I'm a bot)? Here is my code: ``` #import requests import...

The remote server returned an error: (404) Not Found

The remote server returned an error: (404) Not Found I am running this piece of code to get the source code (as string) of my [webpage.](http://www.kickstart.gr) The problem is why this function retur...