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.

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.

See also: ,

17143 questions
131
votes
8 answers

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¶m2=value2 Is it right to say that I can use it with a POST query? POST /service/function { param1 : value1, param2 : value2 } Are…
hank
  • 9,553
  • 3
  • 35
  • 50
130
votes
3 answers

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 clogged because this is in an AsyncTask, and when I…
rasen58
  • 4,672
  • 8
  • 39
  • 74
128
votes
5 answers

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 mean, is there any method that could achieve this…
Rama Rao M
  • 2,961
  • 11
  • 44
  • 64
121
votes
5 answers

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}&sensor=false") void…
Perry Hoekstra
  • 2,687
  • 3
  • 33
  • 52
120
votes
4 answers

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() takes. I know that when I have to store…
Deepak
  • 3,134
  • 2
  • 24
  • 24
115
votes
13 answers

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¶m2=two' to my url, yet it works correctly in Postman. Here's the gist of my…
Peter Birdsall
  • 3,159
  • 5
  • 31
  • 48
113
votes
7 answers

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 given my function take two parameters…
MrSSS16
  • 1,133
  • 2
  • 8
  • 4
105
votes
7 answers

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(){ var http = require('http'); var str = ''; …
Daryl Rodrigo
  • 1,387
  • 2
  • 11
  • 19
105
votes
12 answers

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 beautiful (I think): $current_url = explode('?',…
Jens Törnell
  • 23,180
  • 45
  • 124
  • 206
101
votes
12 answers

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', 'b']; UPDATE: Are there any method like that in…
thom
  • 1,011
  • 2
  • 7
  • 4
100
votes
5 answers

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 that a 204 - No Content is okay for an HTTP…
ecbrodie
  • 11,246
  • 21
  • 71
  • 120
98
votes
7 answers

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 only the following characters: a-z…
caw
  • 30,999
  • 61
  • 181
  • 291
98
votes
5 answers

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, null); curl_setopt($curl_handle, CURLOPT_POST,…
gnosio
  • 1,639
  • 3
  • 14
  • 14
94
votes
6 answers

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, directories=0, resizable=1,…
php-b-grader
  • 3,191
  • 11
  • 42
  • 53
91
votes
6 answers

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.com/js/js_cookies.asp Get cookie by name As you…
user2402179