Questions tagged [http-get]

HTTP GET is a request method which should be used to retrieve data and should not change state of the server.

HTTP GET is a request method which should be used to retrieve data and should not change state of the server.

1622 questions
85
votes
3 answers

What is the difference between [AcceptVerbs(HttpVerbs.Post)] and [HttpPost]?

I can decorate an action either with the [AcceptVerbs(HttpVerbs.Post)]/[AcceptVerbs(HttpVerbs.Get)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(string title) { // Do Something... } or with the [HttpPost]/[HttpGet]…
Lorenzo
  • 29,081
  • 49
  • 125
  • 222
75
votes
5 answers

Standardized way to serialize JSON to query string?

I'm trying to build a restful API and I'm struggling on how to serialize JSON data to a HTTP query string. There are a number of mandatory and optional arguments that need to be passed in the request, e.g (represented as a JSON object below): { …
Andreas
  • 1,211
  • 1
  • 10
  • 21
70
votes
5 answers

PHP cURL GET request and request's body

i'm trying using cURL for a GET request like this: function connect($id_user){ $ch = curl_init(); $headers = array( 'Accept: application/json', 'Content-Type: application/json', ); curl_setopt($ch, CURLOPT_URL,…
itsme
  • 48,972
  • 96
  • 224
  • 345
65
votes
6 answers

Writing image to local server

Update The accepted answer was good for last year but today I would use the package everyone else uses: https://github.com/mikeal/request Original I'm trying to grab google's logo and save it to my server with node.js. This is what I have right now…
Mark
  • 32,293
  • 33
  • 107
  • 137
61
votes
9 answers

How to add query parameters to a HTTP GET request by OkHttp?

I am using the latest okhttp version: okhttp-2.3.0.jar How to add query parameters to GET request in okhttp in java ? I found a related question about android, but no answer here!
Jerikc XIONG
  • 3,517
  • 5
  • 42
  • 71
52
votes
2 answers

How can I use HTTP GET in PowerShell?

Possible Duplicate: Get $webclient.downloadstring to write to text file in Powershell Powershell http post with .cer for auth I have an SMS system that provides me the ability to send an SMS from an HTTP GET…
alex
  • 916
  • 4
  • 12
  • 26
51
votes
6 answers

How can I check if request was a POST or GET request in Symfony2 or Symfony3

I just wondered if there is a very easy way (best: a simple $this->container->isGet() I can call) to determine whether the request is a $_POST or a $_GET request. According to the docs, A Request object holds information about the client request.…
Gottlieb Notschnabel
  • 9,408
  • 18
  • 74
  • 116
49
votes
7 answers

HTTP GET in VB.NET

What is the best way to issue a http get in VB.net? I want to get the result of a request like http://api.hostip.info/?ip=68.180.206.184
notandy
  • 3,330
  • 1
  • 27
  • 35
47
votes
4 answers

HttpPost vs HttpGet attributes in MVC: Why use HttpPost?

So we have [HttpPost], which is an optional attribute. I understand this restricts the call so it can only be made by an HTTP POST request. My question is why would I want to do this?
Shane Courtrille
  • 13,960
  • 22
  • 76
  • 113
45
votes
6 answers

How do I print the content of httprequest request?

I've got a bug involving httprequest, which happens sometimes, so I'd like to log HttpGet and HttpPost request's content when that happens. So, let's say, I create HttpGet like this: HttpGet g = new HttpGet(); g.setURI(new…
Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224
43
votes
7 answers

How can I pass POST parameters in a URL?

Basically, I think that I can't, but I would be very happy to be proven wrong. I am generating an HTML menu dynamically in PHP, adding one item for each current user, so that I get something like
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
40
votes
5 answers

Passing a list of int to a HttpGet request

I have a function similar in structure to this: [HttpGet] public HttpResponseMessage GetValuesForList(List listOfIds) { /* create model */ foreach(var id in listOfIds) model.Add(GetValueForId(id) /* create response…
StormFoo
  • 1,129
  • 2
  • 10
  • 25
39
votes
2 answers

How to pass complex object to ASP.NET WebApi GET from jQuery ajax call?

I have the following complex object in JavaScript which contains filter options var filter={caseIdentifiter:'GFT1',userID:'2'}; which I want to pass to an ASP.NET MVC4 WebApi controller GET [HttpGet] public…
ChrisP
  • 9,796
  • 21
  • 77
  • 121
34
votes
5 answers

How can I use jQuery "load" to perform a GET request with extra parameters?

I'm reading the jQuery load documentation and it mentions that I can use load to perform a GET request by passing in extra parameters as a string. My current code with my parameters as key/value pair is: $("#output").load( …
Thierry Lam
  • 45,304
  • 42
  • 117
  • 144
32
votes
2 answers

How to call Firebase Callable Functions with HTTP?

I realised that the new Callable Cloud Functions can still be called as if they were HTTP events, i.e. they can still be reached under http://us-central1-$projectname.cloudfunctions.net/$functionname. When doing that I receive an error message in my…
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402