exception "ThrottleRequests" errors to many request in api laravel - laravel-5

Since many devices have the same ip address request on the api server, I have a bug to many requests, there is a way to customize the "throttle" that the request is from a single device sent to the server. help me

Related

Issue with MailChimp delete API?

For DELETE APIs, if we hit the API with invalid data, the API responds with proper error message. If we use the same HTTP connection object to hit another API, the request fails.
This issue is not seen for Create or Update APIs. Also if the Delete request is sent with valid data, then using the same HTTP connection object for next request works fine.
Please note that this behavior has implications for connection pooling in client applications, and we were just wondering if its known issue and if there is any available workaround.

Restrict requests from a certain domain with parse.com

Is it possible to restrict requests on Parse.com to a certain domain (i.e. the hosting domain)?
The request in question is a cloud function.
Thanks!
You can get the ip address as part of the request object. You can apply a filter in cloud code to allow request from certain ip otherwise send 401 Unauthorized Request http code.

Intermittent Http Error 403 When Invoking Google Custom Search API

I'm getting the following error intermittently when invoking the custom search api from a server side setup:
HttpError 403 when requesting https://www.googleapis.com/customsearch/v1?q=John+Doe+john%40simpler.com&alt=json&cx=&key= returned "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.
I'm using a server api key, and have confirmed that the configured server ip address is correct. And about 50% of the time my request come back fine, too. I'm issuing the request from the server like this:
service = build("customsearch", "v1",
developerKey=api_key)
custom_search_context = <my_context>
res = service.cse().list(
q=search_query_string,
cx=custom_search_context,
).execute()
My requests per sec are well with in the configured limit of 10/sec and daily purchased limit of 5000 requests.
One more thing I noticed is that Google counts a forbidden request towards the daily limit, too.
Any pointers on why I'm being presented with the error only intermittently would be very helpful
The error can be raised when you're exceeding a request/second limit. Can you confirm that your request rate is below your configured user rate limit? It might be worth noting that the limit is enforced even if you don't explicitly provide a user value in your requests.

Cross Domain access to USPS Address validation API

I am trying to hit USPS address validation API by AJAX call and I am getting 'Cross-Origin Request Blocked' error.
However when I am trying to access the same address though URL, I am getting the results.
Has this error something to do with approval thing?
The id I am using for this has been approved and I am able to get the result by the API through URL.
I want to access it though scripting. Please help.
Any help would be appreciated.
Thanks in advance.
I think the way you might want to do this is to have the Ajax requests go to your web server -- the same HTTP server where the page came from. And then your server-side program (in PHP, or Python or whatever you're using) relays the request to the USPS server.
Making the request browser-side, from Ajax directly to the USPS server, is just the kind of suspicious activity (called Cross-Site Scripting) that browsers are learning to block.
CORS could theoretically be one way to unblock a Cross-Origin Request, but in that scheme it would be the USPS API server that ultimately grants that permission for pages from your domain. Tech detail: by inserting an Access-Control-Allow-Origin header in response to a request with an Origin header in the Ajax back-and-forth.

Multiple URL opening in MFC

I am trying to send simultaneous request for opening URL in OpenURL() in CInternetSession class. But After sending 2 URLS requests, no other request can be send without receiving the response from previously send requests. How can I send a large number of URL request to a server and later only i want to process the response. Please help if any other API is there for sending multiple URL request to a server and receiving the response later. I want to use in MFC windows
The HTTP 1.1 specification (RFC 2068) mandates the two-connection limit.
In this way, WinInet (CInternetSession built on top of it) limits connections per server (MSDN).
You could try to invoke SetOption and adjust INTERNET_OPTION_MAX_CONNS_PER_SERVER and
INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER values. (MSDN)
Something like this:
sess.SetOption(INTERNET_OPTION_MAX_CONNS_PER_SERVER, 8);
sess.SetOption(INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER, 8);

Resources