http-get

How can I query the iTunes search API in javascript?

三世轮回 提交于 2019-12-10 11:43:06
问题 I am trying to query the App Store for information on a given app, however I keep getting the following error. XMLHttpRequest cannot load https://itunes.apple.com/lookup?id=<some-app-id>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.<some-website>.co.uk' is therefore not allowed access. The response had HTTP status code 501. The code I'm using to execute the request is as follows. Does anyone know where I may be going wrong? var config = {

Overload request headers and params with HttpClient get

可紊 提交于 2019-12-10 11:04:08
问题 In HttpClientModule, is there a method to pass headers and params to get request. import { HttpHeaders, HttpParams, HttpClient } from @angular/common/http'; const headers = { headers: new HttpHeaders({}) } let params = new HttpParams({ }); get(url, {params}) // http client get with params get(url, {headers}); //http client get with headers I want something like requestoptions to hold both or a syntax to do httpClient get sending request headers and params. Currently building complete url with

URISyntaxException - How to deal with urls with %

北战南征 提交于 2019-12-08 19:26:59
问题 I am fairly new to Java and came across this issue. I tried searching but never got a correct answer. I have a string for example String name = anything 10%-20% 04-03-07 Now I need to build up a url string with this String name like below. http://something.com/test/anything 10%-20% 04-03-07 I tried replacing the spaces with %20 and now I am getting the new url as http://something.com/test/anything%2010%-20%%2004-03-07 When I use this url and fire it in firefox it just works fine but while

URL Length limitation of Microsoft Edge

女生的网名这么多〃 提交于 2019-12-08 14:50:23
问题 does anybody know URL length limitation for Microsoft Edge? As you know, Internet Explorer has limitation for URL length, Maximum length is 2048. How about Edge? I guess, it should be gone for now... 回答1: The limit appears to be around 81578 characters . After that, I get a silent failure with no request made to the server. The URL I was using to test looked like: http://xx.xx.xxx.xxx:xxxx/?81578-characters-here I'm not sure whether the length of the host name is factored in. It's also worth

Android: Using HttpGet to send a URL

…衆ロ難τιáo~ 提交于 2019-12-08 10:04:59
问题 I'm trying to send a URL to my server that uses values from edittext fields. Currently it continues to force close on the button click. This is what I have: Button testbtn = (Button) findViewById(R.id.Testbtn); testbtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { HttpGet method = new HttpGet("http://mysite.com/test.php?first=<>&last=<>&address=<>&phone=<>&zip=<>&email=<>"); HttpClient client = new DefaultHttpClient(); try { client.execute(method); } catch

Unable to “List channel messages” on Azure AD Graph API Beta

偶尔善良 提交于 2019-12-08 08:50:44
问题 When I try to list channel messages I get: [...] "code": "UnknownError", "message": "Failed to execute backend request." [...] This error is for all teams I don't belong to. I have this error when trying to call the API from Microsoft Flow (with HTTP GET) but also with Graph Explorer: the account I used has FULL permission but still asks to check my permission: Failure - Status Code 403, 656ms Looks like you may not have the permissions for this call. Please modify your permissions And the

Why does the back button not work with HTTP POST?

假如想象 提交于 2019-12-08 07:50:26
问题 What is the reason that we cannot use the browser Back button when we submit a page using HTTP POST? But it is fine with HTTP GET? I have read that the browser tries to prevent multiple POSTS (to avoid multiple updates to server) because it cannot tell the difference between BACK and RELOAD on the browser? How can browser not tell between BACK and RELOAD? 回答1: Back isn't a special request that goes to the server. Back just navigates to the previous page, same as if you just entered the url in

Devise authentication as API only

不打扰是莪最后的温柔 提交于 2019-12-08 06:35:57
问题 I'm trying to use Devise authentication with Angular.js. Everything is already working except I want to hide the server-side login form, i.e. the result of /users/sign_in GET request leaving only the possibility of /users/sign_in POST request. Is this possible? 回答1: I think you'll need to skip sessions in your devise_for call in routes.rb (or not even call it) and just stick to devise_scope for setting up your sign_in path. So, your routes.rb would look like this: devise_for :users, :skip =>

How to return response header field to main method using Google Volley for HTTP GET request in Android / Java?

[亡魂溺海] 提交于 2019-12-07 01:15:27
问题 I'm using google volley for networking in android. I will make a http GET request and need to return a response header value. I found some answers on stack overflow to access the header fields, but don't know how to return it to my calling spot. Please have a look at my code, I put four numbers in it to explain my problem. At (1) I can print out the value which I need. Than I've tried to save it in a class attribute (2) and there is no error in the IDE. If I want to return it from there (3),

HTTP GET and POST semantics and limitations

泪湿孤枕 提交于 2019-12-06 20:32:54
问题 Earlier this week, I had to do something which feels like a semantics violation. Let me explain. I was making a simple AJAX client application, which was to make a request to a service with a given number of parameters. Since the whole app is basically read-only, I thought that using HTTP GET was the way to go. Some of the parameters that I had to pass were simple (such as the sort order, or page number). However, one of the required parameters could be of variable length, and this made me