http-get

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

人盡茶涼 提交于 2019-11-27 06:51:35
问题 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 ? 回答1: It's accessible via any verb. 回答2: In Web API 2.1: it depends on the name of the action. If the action starts with "Get*" then it will default to only accept GET requests. If it starts with "Put*" then it will default to only accept PUT requests. Same with POST. If it doesn't start with any known

REST API: GET request with body

别等时光非礼了梦想. 提交于 2019-11-27 06:35:50
问题 I want to implement a REST API and need a body on my GET requests. (Like discussed here: HTTP GET with request body) Are there http clients which are not able to send a body with a GET request? Fiddler is able to do it, although the message box is red. 回答1: As a general rule, the idea of a GET in REST is that any of your parameters are sent in the URL. As the answer on the question you included indicates, it's doable but misses the point of REST, which is to have a consistent webbish

Is GET data also encrypted in HTTPS?

孤街醉人 提交于 2019-11-27 06:02:39
When you GET https://encrypted.google.com/search?q=%s The %s query is encrypted? Or just the response? If it is not, why should Google serve it's public content also with encryption? Marcelo Cantos The entire request is encrypted, including the URL, and even the command ( GET ). The only thing an intervening party such as a proxy server can glean is the destination address and port. Note, however, that the Client Hello packet of a TLS handshake can advertise the fully qualified domain name in plaintext via the SNI extension (thanks @hafichuk), which is used by all modern mainstream browsers,

pass array of an object to webapi

空扰寡人 提交于 2019-11-27 06:01:30
问题 I have a .net mvc 4 webapi project that I'm trying to pass an array of an object to a method on my controller. I've found some examples here on SO that talk about needing to set my object's properties with: param1=whatever&param2=bling&param3=blah. But I don't see how I can pass in a collection using that. Here is my method signature. Notice I've decorated the argument with the [FromUri] attribute. public List<PhoneResult> GetPhoneNumbersByNumbers([FromUri] PhoneRequest[] id) { List

PHP cURL GET request and request's body

爷,独闯天下 提交于 2019-11-27 05:32:59
问题 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, $this->service_url.'user/'.$id_user); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HEADER, 0); $body = '{}'; curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_POSTFIELDS,$body); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //

Submit a JSF form using GET

柔情痞子 提交于 2019-11-27 04:31:51
问题 How do I submit a form to the same page and use GET parameters? JSF page contents: <f:metadata> <f:viewParam name="item1" value="#{bean.item1}"/> <f:viewParam name="item2" value="#{bean.item2}"/> </f:metadata> ... <h:form> <h:inputText value="#{bean.item1}"/> <h:inputText value="#{bean.item2}"/> <h:button value="Submit" > <f:param name="item1" value="#{bean.item1}"/> <f:param name="item2" value="#{bean.item2}"/> </h:button> </h:form> If I request the page: form.jsf?item1=foo&item2=bar, it

How do I issue an HTTP GET from Excel VBA for Mac

落花浮王杯 提交于 2019-11-27 04:01:01
I need to issue an HTTP Get with a query string to a web service from Excel for Mac 2011. I've seen the answers for using QueryTables ( How can I send an HTTP POST request to a server from Excel using VBA? ) but they use the POST method, not a GET method. I also see that it's easy from a Windows machine, but I'm stuck on a Mac. Any suggestions, or is it hopeless? John Stephens Doing further research, I came across Robert Knight's comment on this question VBA Shell function in Office 2011 for Mac and built an HTTPGet function using his execShell function to call curl. I've tested this on a Mac

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

僤鯓⒐⒋嵵緔 提交于 2019-11-27 03:03:25
问题 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! 回答1: As mentioned in the other answer, okhttp v2.4 offers new functionality that does make this possible. See http://square.github.io/okhttp/2.x/okhttp/com/squareup/okhttp/HttpUrl.Builder.html#addQueryParameter-java.lang.String-java.lang.String- This is not possible with the current version of okhttp, there is no

Receiving Chunked HTTP Data With Winsock

烈酒焚心 提交于 2019-11-27 02:12:14
I'm having trouble reading in some chunked HTTP response data using winsock. I send a request fine and get the following back: HTTP/1.1 200 OK Server: LMAX/1.0 Content-Type: text/xml; charset=utf-8 Transfer-Encoding: chunked Date: Mon, 29 Aug 2011 16:22:19 GMT using winsock recv. At this point however it just hangs. I have the listener running in an infinite loop but nothing is ever picked up. I think it's a C++ issue but it could also be related to the fact that I pushing the connection through stunnel to wrap it up inside HTTPS. I have a test application using some libs in C# which works

How to map a response from http.get to a new instance of a typed object in Angular 2 [duplicate]

只谈情不闲聊 提交于 2019-11-27 01:51:54
问题 This question already has answers here : How do I cast a JSON object to a typescript class (19 answers) Closed 3 years ago . I'm trying to get an understanding in how to map the result from a service call to an object using http.get and Observables in Angular 2. Take a look at this Plunk In the method getPersonWithGetProperty I'm expecting to return an Observable of type PersonWithGetProperty. However! I can't access the property fullName. I guess that I would have to create a new instance of