http-get

Passing a list of int to a HttpGet request

佐手、 提交于 2019-12-31 17:58:26
问题 I have a function similar in structure to this: [HttpGet] public HttpResponseMessage GetValuesForList(List<int> listOfIds) { /* create model */ foreach(var id in listOfIds) model.Add(GetValueForId(id) /* create response for model */ return response; } However, when I do a Get request for the method: {{domain}}/Controller/GetValuesForList?listOfIds=1&listOfIds=2 I get an error when debugging stating that listOfIds is null. In our controller we have a number of public HttpGet methods that work

Using HttpGet returning complete HTML code

会有一股神秘感。 提交于 2019-12-30 11:33:28
问题 I am trying to invoke a private web-service in which there's one link I've to access using GET method. While using the direct URL on browser (needs to login first), I get the data in JSON format. The URL I am invoking is like this http://www.example.com/trip/details/860720?format=json The url is working fine, but when I invoke this using HttpGet , I am getting the HTML coding of the webpage, instead of the JSON String. The code I am using is as follows: private String runURL(String src,int id

need help canonicalizing an HTTP GET form in asp.net mvc

佐手、 提交于 2019-12-29 09:37:11
问题 I have a form in an asp.net mvc site that serves 3 purposes: paging, sorting, and searching. These items should all be rendered in the same form, since returning the correct search results depends on variables from all 3 aspects. What I'm trying to do is move the parameters out of the querystring and put them in a canonical URL. I'm almost there, here are my 3 route configurations so far (using T4MVC for area, controller, and action names): context.MapRoute(null, "my-area/my-widgets/search/

HTTP Get in Google Spreadsheet, “e undefined”

好久不见. 提交于 2019-12-29 08:16:12
问题 I'm trying to use HTTP Get in Google Spreadsheet, to be able to create a URL to a specific cell in a sheet. I've been searching for how to do it, and I've tried using this way (the GET part), for example. Here's the code I've put together: function doGet(e){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName("Kunder"); var row = e.parameter["row"]; var col = e.parameter["col"]; var ss = SpreadsheetApp.getActiveSpreadsheet(); var range = sheet.getRange(row, col);

HTTP Get in Google Spreadsheet, “e undefined”

匆匆过客 提交于 2019-12-29 08:16:01
问题 I'm trying to use HTTP Get in Google Spreadsheet, to be able to create a URL to a specific cell in a sheet. I've been searching for how to do it, and I've tried using this way (the GET part), for example. Here's the code I've put together: function doGet(e){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName("Kunder"); var row = e.parameter["row"]; var col = e.parameter["col"]; var ss = SpreadsheetApp.getActiveSpreadsheet(); var range = sheet.getRange(row, col);

Writing image to local server

依然范特西╮ 提交于 2019-12-27 18:21:24
问题 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 and doesn't work: var options = { host: 'google.com', port: 80, path: '/images/logos/ps_logo2.png' }; var request = http.get(options); request.on('response', function (res) { res.on('data', function (chunk) { fs.writeFile(dir+'image.png', chunk,

Download file from url that doesn't end with .extension [closed]

送分小仙女□ 提交于 2019-12-26 04:55:16
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I've seen examples on how to download files programmatically, but they all use direct links, ending with .txt .mp3 .jpg, whatever. However, the link to the file I want to download isn't a direct link: it doesn't end with .extension. How can you download the file in this case? 回答1: When downloading over HTTP, the

Android HTTP Request for CakePHP URL

﹥>﹥吖頭↗ 提交于 2019-12-25 18:25:37
问题 I have a website which was created with cakephp. I want to pass some values formed in my App to this website. When I enter the exact same URL in the browser it works. The URL is something like: www.something.com/function/add/value So I'm very confused if this is a GET or a POST method? And how I can do that? The thing is that I can NOT change this URL or put some POST or GET PHP script there to get the values. So I basically just have to call the URL with those params. This is my code:

Classic ASP HTTP Post from another server

天大地大妈咪最大 提交于 2019-12-25 18:17:35
问题 I am litte confused, i want to protect one page in classic asp from being accessed by Get Method. Is it possible that someone can post data from another server to my page? If Yes, how to detect that and allow only post from my server. Thanks for help. 回答1: If you are currently using Request("ParameterName") to retrieve parameters then you should change to Request.Form("ParameterName") which will only get the parameter if it was POSTed. Alternatively you can lookup the method used to access

httpGet Request error

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 18:16:34
问题 I would like to get returned value from my webservice. I have my class wich Manages the HTTPRequest: public class RatePromotions { public RatePromotions() {} public String executeHttpGet(String url) throws Exception { BufferedReader in = null; try { HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(); request.setURI(new URI(url)); HttpResponse response = client.execute(request); in = new BufferedReader (new InputStreamReader(response.getEntity().getContent()));