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
88
votes
4 answers

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 the viewOne if I do def viewOne(request): …
yossi
  • 12,945
  • 28
  • 84
  • 110
85
votes
6 answers

Getting DOM element value using pure JavaScript

Is there any difference between these solutions? Solution 1: function doSomething(id, value) { console.log(value); //... } ...and Solution 2: function…
Adam Halasz
  • 57,421
  • 66
  • 149
  • 213
83
votes
7 answers

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 written when you have nested maps to represent a…
Sridhar Sarnobat
  • 25,183
  • 12
  • 93
  • 106
82
votes
18 answers

NodeJS w/Express Error: Cannot GET /

This is what i have, the filename "default.htm" actually exists and loads when doing a readFile with NodeJS. var express = require('express'); var app = express(); app.use(express.static(__dirname +…
sia
  • 2,185
  • 4
  • 20
  • 17
80
votes
9 answers

How to pass extra variables in URL with WordPress

I am having trouble trying to pass an extra variable in the url to my WordPress installation. For example /news?c=123 For some reason, it works only on the website root www.example.com?c=123 but it does not work if the url contains any more…
Chuck D
  • 1,718
  • 4
  • 19
  • 26
76
votes
5 answers

Maven: downloading files from url

Can I download some files from http while maven lifecycle? any plugin?
Jin Kwon
  • 2,005
  • 3
  • 15
  • 15
75
votes
6 answers

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 like to do the same using get instead. Google…
CruelIO
  • 18,196
  • 16
  • 40
  • 58
73
votes
5 answers

How to set cookie secure flag using javascript

I have tried to set a cookie using document.cookie = "tagname = test; secure" but this does not set the secure flag. Am I setting it wrong? Can you only set it from a server response? I am also wondering that, because I have had a difficult time…
BobtheMagicMoose
  • 2,246
  • 3
  • 19
  • 27
71
votes
2 answers

For Restful API, can GET method use json data?

I don't want to see so long parameters string in the URI. So, can GET method use json data? In my situation, I need to filter the result given kind of parameters. If there are a lot of parameter, the length may exceed the limit of URI. So, is there…
HappyLiang
  • 742
  • 1
  • 5
  • 9
71
votes
7 answers

Retrofit: multiple query parameters in @GET command?

I am using Retrofit and Robospice to make API calls in my android application. All @POST methods work great, and so do @GET commands without any parameters in the URL, but I can't get any @GET calls to work with parameters on the end! For example,…
AndroidNoob
  • 2,771
  • 2
  • 40
  • 53
71
votes
5 answers

how to use json file in html code

I have json file mydata.json, and in this file is some json-encoded data. I want obtain this data in file index.html and process this data in JavaScript. But a don't know how to connect.json file in .html file? Tell me please. Here is my json…
saikiran
  • 2,247
  • 5
  • 27
  • 42
68
votes
8 answers

How to check if $_GET is empty?

How to check if $_GET is empty?
Vamsi Krishna B
  • 11,377
  • 15
  • 68
  • 94
68
votes
13 answers

Create a simple HTTP server with Java?

What's the easiest way to create a simple HTTP server with Java? Are there any libraries in commons to facilitate this? I only need to respond to GET/POST, and I can't use an application server. What's the easiest way to accomplish this?
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
68
votes
3 answers

How to set and get fields in struct's method

After creating a struct like this: type Foo struct { name string } func (f Foo) SetName(name string) { f.name = name } func (f Foo) GetName() string { return f.name } How do I create a new instance of Foo and set and get the name? I…
nope
  • 1,060
  • 2
  • 15
  • 32
67
votes
2 answers

is link / href with just parameters (starting with question mark) valid?

Is this link valid? eng I know the browsers treat it as expected and I know the empty link would be ok too - but is it ok to specify just the parameters? I am curious because question mark ("?") is only a convention by most…
johndodo
  • 17,247
  • 15
  • 96
  • 113