get

HTTP keep-alive timeout

爷,独闯天下 提交于 2019-11-28 19:09:10
Can I specify the HTTP timeout or does the server impose a value? For example, if I do: telnet my.server.net 80 Trying X.X.X.X... Connected to my.server.net. Escape character is '^]'. GET /homepage.html HTTP/1.0 Connection: keep-alive Host: my.server.net HTTP/1.1 200 OK Date: Thu, 03 Oct 2013 09:05:28 GMT Server: Apache Last-Modified: Wed, 15 Sep 2010 14:45:31 GMT ETag: "1af210b-7b-4904d6196d8c0" Accept-Ranges: bytes Content-Length: 123 Vary: Accept-Encoding Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html [...] The line: Keep-Alive: timeout=15, max=100 ..

How do you force a web browser to use POST when getting a url?

跟風遠走 提交于 2019-11-28 19:08:20
How do you force a web browser to use POST when getting a url? Use an HTML form that specifies post as the method: <form method="post" action="/my/url/"> ... <input type="submit" name="submit" value="Submit using POST" /> </form> If you had to make it happen as a link (not recommended), you could have an onclick handler dynamically build a form and submit it. <script type="text/javascript"> function submitAsPost(url) { var postForm = document.createElement('form'); postForm.action = url; postForm.method = 'post'; var bodyTag = document.getElementsByTagName('body')[0]; bodyTag.appendChild

For Restful API, can GET method use json data? [duplicate]

浪子不回头ぞ 提交于 2019-11-28 18:36:25
问题 This question already has an answer here: HTTP GET with request body 20 answers 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 best practice for this problem? 回答1: In theory, there's nothing preventing you from sending a request body in a GET request. The HTTP protocol allows it, but have no

HTTP get with headers using RestTemplate

你。 提交于 2019-11-28 18:08:11
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 try to run another asynctask after I click on the button for this one, they won't work. I tried doing String url = "https://api.blah.com/2.0/search/cubes?w=jdfkl&whitespace=1"; MultiValueMap<String, String> map = new LinkedMultiValueMap<String, String>(); map.add("Bearer", accessToken); HttpHeaders headers = new HttpHeaders(); headers.setContentType

Simple objective-c GET request

蓝咒 提交于 2019-11-28 17:54:17
Most of the information here refers to the abandoned ASIHTTPREQUEST project so forgive me for asking again. Effectively, I need to swipe a magnetic strip and send the track 2 data to a webservice that returns "enrolled" or "notenrolled" (depending on the status of the card...) So my data comes in simply as NSData *data = [notification object]; And then I need to pass this to a url to the order of http://example.com/CardSwipe.cfc?method=isenrolled&track2=data And then just receive a response string... I've searched a ton and there seems to be some conflicting answers as to whether this should

How do i pass GET parameters using django urlresolvers reverse

☆樱花仙子☆ 提交于 2019-11-28 17:21:40
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): request.GET['name'] I will get joe how do I do that ? GET parameters have nothing to do with the URL as returned by reverse . Just add it on at the end: url = "%s?name=joe" % reverse(viewOne) A safer and more flexible way: import urllib from django.core.urlresolvers import reverse def build_url(*args, **kwargs): get = kwargs.pop('get', {}) url = reverse(*args, *

How to get an object's methods?

不羁的心 提交于 2019-11-28 17:21:13
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 Jquery? Thank you. function getMethods(obj) { var res = []; for(var m in obj) { if(typeof obj[m] == "function") { res.push(m) } } return res; } Larry Osterman Remember that technically javascript objects don't have methods. They have properties, some of which may be function objects. That means that you can enumerate the methods in an object just like

Retrofit: multiple query parameters in @GET command?

此生再无相见时 提交于 2019-11-28 16:58:00
问题 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, if my API path was "my/api/call/" and I wanted 2 parameters "param1" and "param2" in the URL, the get call would look like: http://www.example.com/my/api/call?param1=value1&param2=value2 so I have setup my @GET interface like so: @GET("/my/api/call

Recommended date format for REST GET API

…衆ロ難τιáo~ 提交于 2019-11-28 16:56:06
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:ssZ for UTC time. Should we use the ISO 8601 version without hyphens and colons, such as: http://api.example.com/start_date/YYYYMMDDThhmmssZ or should we encode the ISO 8601 format, using for example base64 encoding? REST doesn't have a recommended date format. Really it boils down to what works best for your end user and your system. Personally, I would want to stick to a standard like you have

What is the best way to design a HTTP request when somewhat complex parameters are needed?

梦想的初衷 提交于 2019-11-28 16:51:40
I have some web services that I am writing and I am trying to be as RESTful as possible. I am hosting these web services using a HTTPHandler running inside of IIS/ASP.NET/SharePoint. Most of my services expect a HTTP GET. I have two of these that are simply returning some data (i.e., a query) and will be Idempotent , but the parameters may be somewhat complex. Both of them could include characters in the parameters of the service that are not allowed for at least the PATH portion of the URL. Using IIS, ASP.NET, and SharePoint I have found that the following characters in the URL path don't