Skip to main content

Questions tagged [get]

GET is one of many request methods supported by the HTTP protocol. The GET request method is used when the client needs to get data from the server as part of the request-URI.

Filter by
Sorted by
Tagged with
782 votes
9 answers
334k views

Are HTTPS headers encrypted?

When sending data over HTTPS, I know the content is encrypted, however I hear mixed answers about whether the headers are encrypted, or how much of the header is encrypted. How much of HTTPS headers ...
Dan Herbert's user avatar
633 votes
19 answers
933k views

How to get GET request values in Django?

I am currently defining regular expressions in order to capture parameters in a URL, as described in the tutorial. How do I access parameters from the URL as part the HttpRequest object? My ...
sutee's user avatar
  • 12.7k
603 votes
10 answers
162k views

Logout: GET or POST?

This question is not about when to use GET or POST in general; it is about which is the recommended one for handling logging out of a web application. I have found plenty of information on the ...
Daniel Liuzzi's user avatar
448 votes
7 answers
779k views

What is the difference between POST and GET? [duplicate]

I've only recently been getting involved with PHP/AJAX/jQuery and it seems to me that an important part of these technologies is that of POST and GET. First, what is the difference between POST and ...
Hristo's user avatar
  • 46.1k
430 votes
17 answers
713k views

How to retrieve GET parameters from JavaScript [duplicate]

Consider: http://example.com/page.html?returnurl=%2Fadmin For js within page.html, how can it retrieve GET parameters? For the above simple example, func('returnurl') should be /admin. But it should ...
compile-fan's user avatar
  • 17.4k
347 votes
7 answers
437k views

Correct way to pass multiple values for same parameter name in GET request

I'm looking into what is the correct way to pass multiple values for the same parameter name in a GET request. I've seen URLs like this: http://server/action?id=a&id=b And I've seen URLs like ...
stripybadger's user avatar
  • 4,849
341 votes
8 answers
736k views

How to send a GET request from PHP?

I'm planning to use PHP for a simple requirement. I need to download a XML content from a URL, for which I need to send HTTP GET request to that URL. How do I do it in PHP?
Veera's user avatar
  • 33k
337 votes
8 answers
518k views

How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

There is an online HTTP directory that I have access to. I have tried to download all sub-directories and files via wget. But, the problem is that when wget downloads sub-directories it downloads the ...
Omar's user avatar
  • 7,341
335 votes
12 answers
444k views

Passing base64 encoded strings in URL

Is it safe to pass raw base64 encoded strings via GET parameters?
Alix Axel's user avatar
  • 154k
333 votes
8 answers
825k views

How to pass parameters in GET requests with jQuery

How should I be passing query string values in a jQuery Ajax request? I currently do them as follows but I'm sure there is a cleaner way that does not require me to encode manually. $.ajax({ url: ...
HeavenCore's user avatar
  • 7,643
314 votes
29 answers
187k views

Is either GET or POST more secure than the other?

When comparing an HTTP GET to an HTTP POST, what are the differences from a security perspective? Is one of the choices inherently more secure than the other? If so, why? I realize that POST doesn't ...
290 votes
8 answers
440k views

Escaping ampersand in URL

I am trying to send a GET message that contains strings with ampersands and can't figure how to escape the ampersand in the URL. Example: http://www.example.com?candy_name=M&M result => ...
tomermes's user avatar
  • 23.2k
286 votes
15 answers
218k views

When should I use GET or POST method? What's the difference between them?

What's the difference when using GET or POST method? Which one is more secure? What are (dis)advantages of each of them? (similar question)
Adriana's user avatar
  • 8,594
271 votes
6 answers
184k views

How to "perfectly" override a dict?

How can I make as "perfect" a subclass of dict as possible? The end goal is to have a simple dict in which the keys are lowercase. It would seem that there should be some tiny set of primitives I can ...
Paul Biggar's user avatar
  • 28.4k
267 votes
23 answers
335k views

How to build query string with Javascript

Just wondering if there is anything built-in to Javascript that can take a Form and return the query parameters, eg: "var1=value&var2=value2&arr[]=foo&arr[]=bar..." I've been wondering ...
user avatar
227 votes
7 answers
201k views

Do I need a content-type header for HTTP GET requests?

As far as I understood there are two places where to set the content type: The client sets a content type for the body he is sending to the server (e.g. for post) The server sets a content type for ...
Martin Flucka's user avatar
182 votes
7 answers
195k views

How to set timeout for http.Get() requests in Golang?

I'm making a URL fetcher in Go and have a list of URLs to fetch. I send http.Get() requests to each URL and obtain their response. resp,fetch_err := http.Get(url) How can I set a custom timeout for ...
pymd's user avatar
  • 4,251
182 votes
16 answers
266k views

PHP Get all subdirectories of a given directory

How can I get all sub-directories of a given directory without files, .(current directory) or ..(parent directory) and then use each directory in a function?
Adrian M.'s user avatar
  • 7,383
182 votes
18 answers
845k views

Getting "TypeError: Failed to fetch" when the request hasn't actually failed

I'm using fetch API within my React app. The application was deployed on a server and was working perfectly. I tested it multiple times. But, suddenly the application stopped working and I've no clue ...
Amanshu Kataria's user avatar
174 votes
9 answers
247k views

get all keys set in memcached

How can I get all the keys set in my memcached instance(s)? I tried googling, but didn't find much except that PHP supports a getAllKeys method, which means it is actually possible to do this somehow....
Anshul Goyal's user avatar
  • 75.6k
170 votes
14 answers
431k views

Use jQuery to get the file input's selected filename without the path

I used this: $('input[type=file]').val() to get the file name selected, but it returned the full path, as in "C:\fakepath\filename.doc". The "fakepath" part was actually there - not sure if it's ...
marky's user avatar
  • 5,008
160 votes
9 answers
424k views

Python requests library how to pass Authorization header with single token

I have a request URI and a token. If I use: curl -s "<MY_URI>" -H "Authorization: TOK:<MY_TOKEN>" etc., I get a 200 and view the corresponding JSON data. So, I installed requests and ...
user avatar
157 votes
4 answers
465k views

How do I do a HTTP GET in Java? [duplicate]

How do I do a HTTP GET in Java?
user avatar
157 votes
2 answers
367k views

Sending a JSON to server and retrieving a JSON in return, without JQuery

I need to send a JSON (which I can stringify) to the server and to retrieve the resulting JSON on the user side, without using JQuery. If I should use a GET, how do I pass the JSON as a parameter? Is ...
Jérôme Verstrynge's user avatar
147 votes
9 answers
95k views

404 error for Google Tag Manager

Google Tag Manager told me to put this underneath the opening body tag. <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXX" height="0" ...
J82's user avatar
  • 8,377
145 votes
6 answers
208k views

How are POST and GET variables handled in Python?

In PHP you can just use $_POST for POST and $_GET for GET (Query string) variables. What's the equivalent in Python?
Ali's user avatar
  • 266k
145 votes
10 answers
308k views

REST API using POST instead of GET

Let's assume a service offers some funcionality that I can use like this: GET /service/function?param1=value1&param2=value2 Is it right to say that I can use it with a POST query? POST /service/...
hank's user avatar
  • 9,833
145 votes
16 answers
80k views

Spring MVC @PathVariable getting truncated

I have a controller that provides RESTful access to information: @RequestMapping(method = RequestMethod.GET, value = Routes.BLAH_GET + "/{blahName}") public ModelAndView getBlah(@PathVariable String ...
phogel's user avatar
  • 2,035
145 votes
6 answers
239k views

Recommended date format for REST GET API

What's the recommended timestamp format for a REST GET API like this: http://api.example.com/start_date/{timestamp} I think the actual date format should be ISO 8601 format, such as YYYY-MM-DDThh:mm:...
Lorenzo Polidori's user avatar
144 votes
27 answers
442k views

How to get the Full file path from URI

I'd like to get the full file path, from a URI. The URI isn't a Image, but it's a music file, but if i do it like the MediaStore Solution, it won't work if the app user selects eg Astro as browser, ...
tim687's user avatar
  • 2,266
142 votes
6 answers
184k views

Why doesn't requests.get() return? What is the default timeout that requests.get() uses?

In my script, requests.get never returns: import requests print ("requesting..") # This call never returns! r = requests.get( "http://www.some-site.example", proxies = {'...
Sarfaraz Nawaz's user avatar
137 votes
3 answers
234k views

HTTP get with headers using RestTemplate

How can I send a GET request using the Spring RestTemplate? Other questions have used POST, but I need to use GET. When I run this, the program continues to work, but it seems that the network is ...
rasen58's user avatar
  • 4,971
134 votes
4 answers
118k views

Is it possible to use getters/setters in interface definition?

At the moment, TypeScript does not allow use get/set methods(accessors) in interfaces. For example: interface I { get name(): string; } class C implements I { get name(): string { ...
Ivan Popov's user avatar
  • 1,351
131 votes
5 answers
180k views

Get an element by index in jQuery

I have an unordered list and the index of an li tag in that list. I have to get the li element by using that index and change its background color. Is this possible without looping the entire list? I ...
Rama Rao M's user avatar
  • 3,021
126 votes
4 answers
353k views

In Flask, what is "request.args" and how is it used?

As a Flask beginner, I can't understand how request.args is used. I read somewhere that it is used to return values of query string (correct me if I'm wrong) and how many parameters request.args.get() ...
Deepak Kumar Singh's user avatar
125 votes
13 answers
174k views

How do you add query parameters to a Dart http request?

How do you correctly add query parameters to a Dart http get request? I been unable to get my request to respond correctly when trying to append the '?param1=one&param2=two' to my url, yet it ...
Peter Birdsall's user avatar
121 votes
5 answers
206k views

Retrofit and GET using parameters

I am trying to send a request to the Google GeoCode API using Retrofit. The service interface looks like this: public interface FooService { @GET("/maps/api/geocode/json?address={zipcode}&...
Perry Hoekstra's user avatar
113 votes
8 answers
144k views

Swift GET request with parameters

I'm very new to swift, so I will probably have a lot of faults in my code but what I'm trying to achieve is send a GET request to a localhost server with paramters. More so I'm trying to achieve it ...
MrSSS16's user avatar
  • 1,133
113 votes
5 answers
276k views

HTTP Get with 204 No Content: Is that normal

Is it a normal occurrence for an HTTP GET Request to have a response with status code 204 - No Content? Like, is this semantically correct concerning what an HTTP GET is supposed to accomplish? I know ...
ecbrodie's user avatar
  • 11.7k
106 votes
12 answers
184k views

Beautiful way to remove GET-variables with PHP?

I have a string with a full URL including GET variables. Which is the best way to remove the GET variables? Is there a nice way to remove just one of them? This is a code that works but is not very ...
Jens Törnell's user avatar
105 votes
8 answers
286k views

How to get data out of a Node.js http get request

I'm trying to get my function to return the http get request, however, whatever I do it seems to get lost in the ?scope?. I'm quit new to Node.js so any help would be appreciated function getData(){ ...
Daryl Rodrigo's user avatar
105 votes
8 answers
166k views

Characters allowed in GET parameter

Which characters are allowed in GET parameters without encoding or escaping them? I mean something like this: http://www.example.org/page.php?name=XYZ What can you have there instead of XYZ? I think ...
caw's user avatar
  • 31.3k
103 votes
12 answers
133k views

How to get an object's methods?

Is there a method or propertie to get all methods from an object? For example: function foo() {} foo.prototype.a = function() {} foo.prototype.b = function() {} foo.get_methods(); // returns ['a', '...
thom's user avatar
  • 1,031
100 votes
5 answers
287k views

How to switch from POST to GET in PHP CURL

I have tried switching from a previous Post request to a Get request. Which assumes its a Get but eventually does a post. I tried the following in PHP : curl_setopt($curl_handle, CURLOPT_POSTFIELDS, ...
gnosio's user avatar
  • 1,659
99 votes
6 answers
115k views

Can't access cookies from document.cookie in JS, but browser shows cookies exist

I can't access any cookie from JavaScript. I need to read some value and send them via JSON for my custom checks. I've tried to access cookies from JS, like it was described at: http://www.w3schools....
user avatar
96 votes
6 answers
189k views

Javascript window.open pass values using POST

I have a javascript function that uses window.open to call another page and returning the result. Here is the section of my code: var windowFeatures = "status=0, toolbar=0, location=0, menubar=0, ...
php-b-grader's user avatar
  • 3,295
90 votes
4 answers
49k views

How do i pass GET parameters using django urlresolvers reverse

I am using django 1.2 and going from one view to another using the urlresolvers reverse method. url = reverse(viewOne) and I want to pass a get parameter, for example name = 'joe' so that in ...
yossi's user avatar
  • 13.2k
89 votes
6 answers
599k views

Getting DOM element value using pure JavaScript

Is there any difference between these solutions? Solution 1: function doSomething(id, value) { console.log(value); //... } <input id="theId" value="test" onclick="doSomething(this.id, ...
Adam Halasz's user avatar
  • 58.1k
87 votes
7 answers
111k views

Java map.get(key) - automatically do put(key) and return if key doesn't exist?

I am sick of the following pattern: value = map.get(key); if (value == null) { value = new Object(); map.put(key, value); } This example only scratches the surface of the extra code to be ...
Sridhar Sarnobat's user avatar
83 votes
6 answers
436k views

How to make an HTTP get request with parameters

Is it possible to pass parameters with an HTTP get request? If so, how should I then do it? I have found an HTTP post requst (link). In that example the string postData is sent to a webserver. I would ...
CruelIO's user avatar
  • 18.5k

1
2 3 4 5
…
344