Questions tagged [httprequest]

HTTP Request is a message within a request/response sequence, according to HTTP specification. May also refer an HttpRequest class in software frameworks and libraries that automates relevant functionality

httprequest
Filter by
Sorted by
Tagged with
2132 votes
12 answers
1.2m views

How to use java.net.URLConnection to fire and handle HTTP requests

Use of java.net.URLConnection is asked about pretty often here, and the Oracle tutorial is too concise about it. That tutorial basically only shows how to fire a GET request and read the response. It ...
1482 votes
17 answers
2.5m views

Send HTTP POST request in .NET

How can I make an HTTP POST request and send data in the body?
Hooch's user avatar
  • 29.3k
1472 votes
9 answers
624k views

Local Storage vs Cookies [closed]

I want to reduce load times on my websites by moving all cookies into local storage since they seem to have the same functionality. Are there any pros/cons (especially performance-wise) in using local ...
Gio Borje's user avatar
  • 20.7k
1309 votes
14 answers
403k views

Are HTTPS URLs encrypted?

Are all URLs encrypted when using TLS/SSL (HTTPS) encryption? I would like to know because I want all URL data to be hidden when using TLS/SSL (HTTPS). If TLS/SSL gives you total URL encryption then ...
Daniel Kivatinos's user avatar
1139 votes
24 answers
1.6m views

How is an HTTP POST request made in node.js?

How can I make an outbound HTTP POST request, with data, in node.js?
Mark's user avatar
  • 68.5k
615 votes
14 answers
644k views

How to send a PUT/DELETE request in jQuery?

GET:$.get(..) POST:$.post().. What about PUT/DELETE?
user198729's user avatar
  • 62.7k
482 votes
4 answers
637k views

What are all the possible values for HTTP "Content-Type" header?

I have to validate the Content-Type header value before passing it to an HTTP request. Is there a specific list for all the possible values of Content-Type? Otherwise, is there a way to validate the ...
Awesome's user avatar
  • 6,079
393 votes
13 answers
475k views

Simulate a specific CURL in PostMan

I am using Postman to test some Curl requests to an API server. The API developers gave us the curl command, but I can't send it from the Postman. How to make such a request from the Postman? curl -X ...
Marin Bînzari's user avatar
368 votes
9 answers
509k views

How can I add a custom HTTP header to ajax request with js or jQuery?

Does anyone know how to add or create a custom HTTP header using JavaScript or jQuery?
Txugo's user avatar
  • 5,048
362 votes
25 answers
786k views

How do you make a HTTP request with C++?

Is there any way to easily make a HTTP request with C++? Specifically, I want to download the contents of a page (an API) and check the contents to see if it contains a 1 or a 0. Is it also possible ...
Sam Becker's user avatar
  • 19.4k
355 votes
16 answers
622k views

Postman: How to make multiple requests at the same time

I want to POST data from Postman Google Chrome extension. I want to make 10 requests with different data and it should be at the same time. Is it possible to do such in Postman? If yes, can anyone ...
user3384231's user avatar
  • 3,853
336 votes
4 answers
796k views

Using headers with the Python requests library's get method

So I recently stumbled upon this great library for handling HTTP requests in Python; found here http://docs.python-requests.org/en/latest/index.html. I love working with it, but I can't figure out ...
Breedly's user avatar
  • 13.5k
268 votes
12 answers
641k views

Proxies with Python 'Requests' module

Just a short, simple one about the excellent Requests module for Python. I can't seem to find in the documentation what the variable 'proxies' should contain. When I send it a dict with a standard &...
user avatar
263 votes
3 answers
704k views

Python Request Post with param data

This is the raw request for an API call: POST http://192.168.3.45:8080/api/v2/event/log?sessionKey=b299d17b896417a7b18f46544d40adb734240cc2&format=json HTTP/1.1 Accept-Encoding: gzip,deflate ...
slysid's user avatar
  • 5,318
236 votes
7 answers
364k views

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: id = 13 name = Jack What is the simplest way to do that? I don'...
angeant's user avatar
  • 2,815
235 votes
8 answers
243k views

Understanding Chrome network log "Stalled" state

I've a following network log in chrome: I don't understand one thing in it: what's the difference between filled gray bars and transparent gray bars.
setec's user avatar
  • 15.8k
230 votes
14 answers
617k views

HTTP GET Request in Node.js Express

How can I make an HTTP request from within Node.js or Express.js? I need to connect to another service. I am hoping the call is asynchronous and that the callback contains the remote server's response....
Travis Parks's user avatar
  • 8,545
229 votes
13 answers
571k views

Asynchronous Requests with Python requests

I tried the sample provided within the documentation of the requests library for python. With async.map(rs), I get the response codes, but I want to get the content of each page requested. This, for ...
trbck's user avatar
  • 5,297
224 votes
9 answers
269k views

Request Monitoring in Chrome

In Firefox, I use Firebug which allows me to view every http request my ajax calls are making. I've switched over my development to Chrome and am liking it so far. My only complaint, however, is ...
Wes P's user avatar
  • 9,720
201 votes
12 answers
309k views

How can I get the baseurl of site?

I want to write a little helper method which returns the base URL of the site. This is what I came up with: public static string GetSiteUrl() { string url = string.Empty; HttpRequest request =...
Jaggu's user avatar
  • 6,348
191 votes
4 answers
443k views

How to send cookies in a post request with the Python Requests library?

I'm trying to use the Requests library to send cookies with a post request, but I'm not sure how to actually set up the cookies based on its documentation. The script is for use on Wikipedia, and the ...
Ricardo Altamirano's user avatar
187 votes
17 answers
66k views

Microsoft CDN for jQuery or Google CDN? [closed]

Does it actually matter which CDN you use to link to your jquery file or any javascript file for that matter. Is one potentially faster than the other? What other factors could play a role in which ...
Xaisoft's user avatar
  • 46.1k
183 votes
13 answers
294k views

How to extract custom header value in Web API message handler?

I currently have a message handler in my Web API service that overrides 'SendAsync' as follows: protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, ...
atconway's user avatar
  • 21k
171 votes
10 answers
171k views

Adding header to all request with Retrofit 2

Retrofit 2's documentation says: Headers that need to be added to every request can be specified using an OkHttp interceptor. It can be done easily using the previous version, here's the related ...
Ashkan Sarlak's user avatar
167 votes
3 answers
375k views

How to extract HTTP response body from a Python requests call?

I'm using the Python requests library. I'm trying to figure out how to extract the actual HTML body from a response. The code looks a bit like this: r = requests.get(...) print r.content This should ...
Stephen Gross's user avatar
163 votes
10 answers
198k views

How to use HttpWebRequest (.NET) asynchronously?

How can I use HttpWebRequest (.NET, C#) asynchronously?
Jason's user avatar
  • 16.9k
145 votes
2 answers
212k views

Python Requests package: Handling xml response

I like very much the requests package and its comfortable way to handle JSON responses. Unfortunately, I did not understand if I can also process XML responses. Has anybody experience how to handle ...
Andy's user avatar
  • 9,701
144 votes
10 answers
184k views

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 other data. What would be the best way to get all ...
Mridang Agarwalla's user avatar
143 votes
5 answers
130k views

Usage of EnsureSuccessStatusCode and handling of HttpRequestException it throws

What's the usage pattern of HttpResponseMessage.EnsureSuccessStatusCode()? It disposes of the Content of the message and throws HttpRequestException, but I fail to see how to programmatically handle ...
G. Stoynev's user avatar
  • 7,545
141 votes
4 answers
53k views

ASP.NET MVC: Is Controller created for every request?

Very simple question: Are controllers in ASP.NET created for every HTTP request, or are they created at application startup and reused throughout requests? Will the controller be created only for a ...
Rasto's user avatar
  • 17.5k
139 votes
10 answers
292k views

How to get HTTP Response Code using Selenium WebDriver

I have written tests with Selenium2/WebDriver and want to test if HTTP Request returns an HTTP 403 Forbidden. Is it possible to get the HTTP response status code with Selenium WebDriver?
Ralph's user avatar
  • 120k
129 votes
4 answers
313k views

Spring 3 MVC accessing HttpRequest from controller

I would like to handle request and session attributes myself rather then leave it to spring @SessionAttributes, for login of cookies handling for example. I just cant figure out how could I access ...
JBoy's user avatar
  • 5,569
126 votes
7 answers
227k views

What's the best way to get the current URL in Spring MVC?

I'd like to create URLs based on the URL used by the client for the active request. Is there anything smarter than taking the current HttpServletRequest object and it's getParameter...() methods to ...
Koraktor's user avatar
  • 42k
123 votes
8 answers
262k views

How to set a Header field on POST a form?

How can I set a custom field in POST header on submit a form?
Reza Owliaei's user avatar
  • 3,323
121 votes
3 answers
202k views

How to use curl to get a GET request exactly same as using Chrome?

I have a web api http://something.com/api and I want to use GET to get the response body. This is my command: curl "http://something.com/api" Of course, it fails and gives an error message. When I ...
wdetac's user avatar
  • 2,772
121 votes
5 answers
108k views

RESTful Alternatives to DELETE Request Body

While the HTTP 1.1 spec seems to allow message bodies on DELETE requests, it seems to indicate that servers should ignore it since there are no defined semantics for it. 4.3 Message Body A ...
shelley's user avatar
  • 7,276
120 votes
4 answers
188k views

Is it possible to add Request Headers to an iframe src request?

I understand that you can set HTTP request headers very easily when making AJAX calls in JavaScript. However is it also possible to set custom HTTP request headers when inserting an iframe into a ...
onlywei's user avatar
  • 1,477
116 votes
8 answers
238k views

How to send a JSON object over Request with Android?

I want to send the following JSON text {"Email":"[email protected]","Password":"123456"} to a web service and read the response. I know to how to read JSON. The problem is that the above JSON object ...
AndroidDev's user avatar
  • 16.1k
115 votes
10 answers
174k views

Why is this HTTP request not working on AWS Lambda?

I'm getting started with AWS Lambda and I'm trying to request an external service from my handler function. According to this answer, HTTP requests should work just fine, and I haven't found any ...
awendt's user avatar
  • 13.3k
114 votes
6 answers
172k views

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) may not be affected (like a product listing) and to use POST when ...
Rupesh Patel's user avatar
  • 3,025
113 votes
20 answers
286k views

How to upload images and file to a server in Flutter?

I use a web service for image processing , it works well in Postman: Now I want to make http request in flutter with Dart: import 'package:http/http.dart' as http; static ocr(File image) ...
Mneckoee's user avatar
  • 3,024
112 votes
5 answers
270k views

How to send POST request in JSON using HTTPClient in Android?

I'm trying to figure out how to POST JSON from Android by using HTTPClient. I've been trying to figure this out for a while, I have found plenty of examples online, but I cannot get any of them to ...
user avatar
110 votes
13 answers
157k views

Http Servlet request lose params from POST body after read it once

I'm trying to access two http request parameters in a Java Servlet filter, nothing new here, but was surprised to find that the parameters have already been consumed! Because of this, they are not ...
amuniz's user avatar
  • 3,322
105 votes
6 answers
116k views

nodejs - How to promisify http.request? reject got called two times

I'm trying to wrap http.request into Promise: new Promise(function(resolve, reject) { var req = http.request({ host: '127.0.0.1', port: 4000, method: 'GET', path: ...
happy_marmoset's user avatar
103 votes
4 answers
216k views

IIS Request Timeout on long ASP.NET operation

I am experiencing a request timeout from IIS when I run a long operation. Behind the scene my ASP.NET application is processing data, but the number of records being processed is large, and thus the ...
Tachi's user avatar
  • 1,416
98 votes
5 answers
288k views

How to get POST request values in Django?

I have the following django template (http://IP/admin/start/ is assigned to a hypothetical view called view): {% for source in sources %} <tr> <td>{{ source }}</td> <...
Randall Ma's user avatar
  • 10.6k
97 votes
6 answers
99k views

Set timeout for HTTPClient get() request

This method submits a simple HTTP request and calls a success or error callback just fine: void _getSimpleReply( String command, callback, errorCallback ) async { try { ...
SteAp's user avatar
  • 11.9k
96 votes
2 answers
136k views

How do I request and process JSON with python?

I am trying to send a GET request to a URL that I know returns data in the form of JSON using python. I would like to know how to send this request to http://someurl/path/to/json, and how to parse ...
sa125's user avatar
  • 28.6k
96 votes
11 answers
138k views

Ruby send JSON request

How do I send a JSON request in ruby? I have a JSON object but I dont think I can just do .send. Do I have to have javascript send the form? Or can I use the net/http class in ruby? With header - ...
Andy's user avatar
  • 1,129
95 votes
4 answers
118k views

When should one use CONNECT and GET HTTP methods at HTTP Proxy Server?

I'm building a WebClient library. Now I'm implementing a proxy feature, so I am making some research and I saw some code using the CONNECT method to request a URL. But checking it within my web ...
Alexsandro's user avatar
  • 1,231

1
2 3 4 5
165