http-get

Use HttpGet with illegal characters in the URL

I am trying to use DefaultHttpClient and HttpGet to make a request to a web service. Unfortunately the web service URL contains illegal characters such as { (ex: domain.com/service/{username}). It's obvious that the web service naming isn't well written but I can't change it. When I do HttpGet(url), I get that I have an illegal characte...

HTTP: can GET and POST requests from a same machine come from different IPs?

I'm pretty sure I remember reading --but cannot find back the links anymore-- about this: on some ISP (including at least one big ISP in the U.S.) it is possible to have a user's GET and POST request appearing to come from different IPs. (note that this is totally programming related, and I'll give an example below) I'm not talking abo...

ASMX web-services and HTTP GET

I'm trying create a ASMX webservice that can perform a HTTP GET request. I have the following simple snippet of code to illustrate what I've already done. using System.Web.Script.Services; ... [WebMethod] [ScriptMethod(UseHttpGet = true)] public string HelloWorld(HttpContext context) { return context.Request.Params.Get("userId").ToStr...

Returning a string from a http GET using asp.net web forms project

I am trying to dynamically generate JavaScript with just a URL get request. I have accomplished this with asp.net MVC by just returning a string from the action and writing the script tag like this. <script type='text/javascript' src='script/get/123'></script> The problem is I need to accomplish the same type of dynamically generated...

Is there some http GET response that I can add to fix an encoding problem on the client web browser?

I have an embedded web server written in C using uIP libraries, in a microcontroller, which outputs the following static text in response to an http get. It is shown below as a C literal string: "HTTP/1.0 200 OK\r\n" "Server: UIP/1.0 (http://www.something.com/)\r\n" "Content-type: text\html\r\n" Right after that comes the doctype stri...

Twitter API Call Failing Intermittently

I'm using PHP to display the most recent tweet from a user. This is in Wordpress. This works most of the time - but sometimes, I get this error: file_get_contents(http://api.twitter.com/1/statuses/user_timeline/[username].json) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in [...]...

How to respond (if possible) to http get requests in GWT?

I would like to make a http get request with my Android phone (i know how to do that) and get the file in return (or some other response from database on the server). Is it possible to do that in GWT (i just started reading tutorials) on the server side or will i have to learn PHP or sth. else? I've seen this http://code.google.com/webt...

Is there a way to merge get parameters? - HTML/Javascript

Hi folks, often I find myself suprized about simple things, I'm not sure but I believe that this might be one of them. Often I find myself needing to merge get attributes, especially within filters and search pages within sites. This come be at times quite complicated, as you might want to remove and add parameters dynamically. Simple...

How to make http get request from servlet to obtain image?

Hi! I would to get qr code from google chart API in my servlet (e.g. http://chart.apis.google.com/chart?chs=200x200&amp;cht=qr&amp;chld=M&amp;chl=hello). What libraries (jars) do i need and how should i save the response (maybe to byte array?) ...

HTTP get method returns http host connect exception

Hello all, I am trying to get the response from a URI using httpclient and httpget. when i am trying to execute the httpclient.execute method it is giving me the http host connect exception. However when i am passing the same URI to the XML parsing code as inputstream the code works fine. Does someone has any idea on the problem.. Help...

Why do I get the proper URL response from a browser, but empty within Android's "HttpGet"?

I am writing an android application which uses a REST-based API on the server. So far the login works perfectly using HttpGet = I send the credentials, it sends me back a JSON response object containing session id or failure. I then moved onto using another get api (this one is passed the sessionid) and the response I get back looks like...

how to send HTTP request by GET method in PHP to another website

Hi everyone, I'm developing a web application for sending SMS to mobile from website like 160by2. I can prepare the URL required for the HTTP GET request as mentioned in the API provided by the SMS Gateway provider smslane.com, here is the link for the API. how to send the HTTP request from PHP? I used cURL for that purpose but the r...

Problem with HTTP Get request parameters and Facebook

Hi, I need to send a GET request from a Facebook canvas application to an external URL. I'm using cURL to send the request. It seems like Facebook ignores the parameters of the GET request, except the first one. Say I have: http://url.com/page.php?param1=value1&amp;param2=value2&amp;param3=value3. The script page.php should write valu...

What is the default behaviour of a controller action not marked with AcceptVerbs, HttpGet or HttpPost?

If I create a controller action and do not decorate it with AcceptVerbs, HttpPost or HttpGet. What is the default behaviour? Does the action allow any access method or does it default to GET? ...

How to limit access to an [HttpGet] ActionResult in ASP.NET MVC?

Imagine I have an ActionResult like this: [HttpGet] public ActionResult Cities(string q) { //Return a list of cities that matches parameter } How do I stop all other sites apart from mine using this as if it's their own little REST-based service for getting a list of matching cities? Is checking the referrer the only way to go...

Asynchronous WebRequests using C#

Hi i have a function that passes url Get parameters to a php file on a webserver and waits for a response from the file (normally takes 10-20 seconds). I want to put this inside a loop because I have to send these Get requests to about 5 different php files at once but when i try to add it to a loop the function makes the loop wait until...

Sending sensitive data as a query string parameter

We are reviewing the design of a system. And need to verify what we think may be a security issue. In this system some sensitive information is sent in the query string. Question is: Can the query string parameters be read as the request goes over the internet, even if the request is sent over https? Can the query string parameters be...

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] attributes [HttpPost] public ActionResult Create(string title) { // Do Something... } Are they di...

Parsing HTTP Get requests into constituent fields

I have fields like: "GET /?blahblahblah HTTP/1.1" 200 43 "http://www.thesun.co.uk/sol/homepage/" 1 blahblah - "en-gb" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB0.0; FunWebProducts; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" i'm looking for a java library o...

Multiple HTTP GET parameters with the same identifier

Let's say I am getting requests such as: http://www.example.com/index.php?id=123&amp;version=3&amp;id=234&amp;version=4 Is it possible to extract these in a simple way inside my php code? I realize I could get the entire querystring with javascript using window.location.href and handle it manually but I'm looking for something more ele...