httprequest

How to request movie data from Rotten Tomatoes using their JSON API?

会有一股神秘感。 提交于 2019-12-05 18:40:14
In my Android application I have one EditText , one Button , and one Listview . When I type a movie name into my EditText field and press on the Button , I want the ListView to be populated with movie names from the Rotten Tomatoes website that match what I entered into the EditText field. But I can't figure out how to use the Rotten Tomatoes JSON API to get the movie data. How do I do it? Xå-k9IdI'-I0llwlg'I - Basically, you need to do four things: Get a Rotten Tomatoes API key for your Android application, which you can do here . This key identifies your app to their service and gives you

HttpRequest.ServerVariables vs HttpRequest.UserAgent Properties VB.net

北慕城南 提交于 2019-12-05 16:58:52
What would be the difference (if any) and advantages/disadvantages between these two properties used to determine the user agent? Dim strUserAgt as String userAgent = Request.userAgent vs. Dim strUserAgt as String = Request.ServerVariables("HTTP_USER_AGENT") Source: How to determine browser type in server-side code without the BrowserType object in ASP.NET In ASP.NET, you can access the Request.ServerVariables collection or use the new Request.UserAgent property to retrieve the HTTP_USER_AGENT header value. There are no difference, both will retrieve same thing HTTP_USER_AGENT header value .

preemptive authentication why

只谈情不闲聊 提交于 2019-12-05 14:46:59
Why preemptive authentication required ? System.setProperty("httpclient.authentication.preemptive", "true"); I had written web services access client program in java. Where we were setting username and password in call object and that was working perfectly. Recently, our service provider made some changes at their side and after that they were not receiving username & password in web service call and as they were not receiving username & passwod so we were not able to connect to their (provider) service. Then i did googling and found about preemptive authentication. While calling web services

Parse HTTP request without using regexp

时光毁灭记忆、已成空白 提交于 2019-12-05 13:12:37
I'm using a regex to separate the fields of an HTTP request: GET /index.asp?param1=hello&param2=128 HTTP/1.1 This way: smatch m; try { regex re1("(GET|POST) (.+) HTTP"); regex_search(query, m, re1); } catch (regex_error e) { printf("Regex 1 Error: %d\n", e.code()); } string method = m[1]; string path = m[2]; try { regex re2("/(.+)?\\?(.+)?"); if (regex_search(path, m, re2)) { document = m[1]; querystring = m[2]; } } catch (regex_error e) { printf("Regex 2 Error: %d\n", e.code()); } Unfortunately this code works in MSVC but not with GCC 4.8.2 (which I have on Ubuntu Server 14.04). Can you

In a Dart console application, is there a library for an HTTP Request that doesnt require DOM access?

[亡魂溺海] 提交于 2019-12-05 13:01:08
I started off by trying to use HTTPRequest in dart:html but quickly realised that this is not possible in a console application. I have done some Google searching but can't find what I am after (only finding HTTP Server), is there a method of sending a normal HTTP request via a console application? Or would I have to go the method of using the sockets and implement my own HTTP request? There's an HttpClient class in the IO library for making HTTP requests: import 'dart:io'; void main() { HttpClient client = new HttpClient(); client.getUrl(Uri.parse("http://www.dartlang.org/")) .then(

Protect HTTP request from being called by others

こ雲淡風輕ζ 提交于 2019-12-05 11:58:16
I have an Android application from which I want to upload some data to a database on my web server. As the MySql java library has a size of about 5 mb, I don't want to include it with the application. So I'll make a HTTP request for a php script and send the data with the URL as parameters. How do I make sure that only I can call this? I don't want people to sniff up the URL and call it outside my application. Thanks Use a simple static token to identify the client is yourself or in an advance way, first authenticate with a username/password, generate a token and use this token for further

Convert HttpRequestMessage to HttpRequest

纵饮孤独 提交于 2019-12-05 11:10:24
问题 I'm converting ASP.NET web application to MVC Web Api project. One of my methods expects HttpRequest class. However, Web Api controller holds only HttpRequestMessage ( this.Request ) object. Do you know how I can convert HttpRequestMessage to HttpRequest ? 回答1: You probably don't need to convert from HttpRequestMessage . There is another way: var context = new HttpContextWrapper(HttpContext.Current); HttpRequestBase request = context.Request; 回答2: Try to use/create a HttpRequestWrapper using

Sending (nested) json object with file using Postman

自作多情 提交于 2019-12-05 10:10:24
With Postman, I can attach files in requests with form-data, I can also send nested JSON object in raw format, but how can I do both: sending nested-structure data with file, e.g: "data": { "normal_fields": { "field1": "value1", "field2": "value2" }, "image_file": <file> } Try setting values like below and choose file to upload. It didn't worked for me like that. For me only worked this way: property[nested_field1] property[nested_field2] or arrays with objects: array[0][nested_field1] array[0][nested_field2] array[1][nested_field1] array[1][nested_field2] 来源: https://stackoverflow.com

How to solve error “Invalid use of BasicClientConnManager : Make sure to release the connection before allocating another one” in Android?

ⅰ亾dé卋堺 提交于 2019-12-05 09:17:25
Here I am trying to POST some data from mobile to the server.For that First I have to login for authentication on the server. then after I am sending the data via POST request I have checked this related stackoverflow question. HttpClient 4.0.1 - how to release connection? I have tried all these methods one by one. 1.EntityUtils.consume(entity); 2.is.close(); response.getEntity().consumeContent(); //in that consumeContent() shows to be Deprecated post.abort(); Here is my detailed code in the pastebin links please check this. Here are the program flow. First login is called Check HERE MY LOGIN

How to measure request and response time of server?

空扰寡人 提交于 2019-12-05 08:56:58
I am using asynctask and json parsing for getting response from server,How can i measure request and response time,following is code of my web service,can any one help me with this?............................ public class JSONParser { static InputStream is = null; static JSONObject jObj = null; static String json = ""; // constructor public JSONParser() { } // function get json from url // by making HTTP POST or GET method public JSONObject makeHttpRequest(String url, String method, List<NameValuePair> params) { // Making HTTP request try { // check for request method if(method.equals("POST")