How to get cakephp to reduce the size of HTTP Post response? - cakephp

I have used cakephp's cake bake facility to quickly build a simple website. My application involves plenty of HTTP POST to add records to the database. However, it is not as fast as I like and the web host provider has a quota for network traffic.
I am using python request module to send the HTTP POST. I noticed that the HTTP response from cakephp is quite a lot. How to get cakephp to reduce the size of its HTTP Post response? I don't really care about the response.
I am using cakephp 2.3

$this->response->statusCode(204);
return $this->response;
will send a response without any content and statuscode 204, meaning the resource was created

Related

How to retrieve SSO CA Siteminder's headers from Spring + React application

I need to retrieve SSO Siteminder's headers from the request.
It seems it is not possible to do it from browser/js because they are server side headers.
I can see the cookie session broeser correctly set, now I need to read the headers from the request, but I could not achieve this.
I've seen some topic in which they got them using a while loop in a JSP page.
Should I do it from Java Spring or is there some other way?
Every server-side webapp language and framework has methods for inspecting the inbound HTTP request to see the headers, including JEE, Spring Framework, even NodeJS.

429 (Too Many Requests) error calling Hubspot API via cors-anywhere.herokuapp

I'm trying to build a web-application using React and for that I'm using Hubspot API to manage contacts in my account. For the HTTP request I'm using JavaScript library 'request-promise' with the proxy server: https://cors-anywhere.herokuapp.com/
Code below:
do{
//Here I'm making http request constantly
}while(process);
After around 100 HTTP requests, the application shows me the error:
GET
https://cors-anywhere.herokuapp.com/https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=${hapiKey}&count=1000
429 (Too Many Requests)
https://cors-anywhere.herokuapp.com/ seems to have rate-limiting issues. Does someone has any solution for that?
Have you tried running a server locally? https://github.com/Rob--W/cors-anywhere

OPTIONS Error using twitter API (400)

For my personal website, I'd like to create a page summarizing my social presence.
I used Postman to make sure all my queries are valid.
So I made simple call to get my last post on twitter.
Everything works find on Postman, so there isn't any Authorization issues.
But when it comes to implement it on my client (using AngularJs ), I'm getting this error:
OPTIONS https://api.twitter.com/1.1/statuses/user_timeline.json?user_id=1106474965 400 ()
XMLHttpRequest cannot load https://api.twitter.com/1.1/statuses/user_timeline.json?user_id=1106474965. Response for preflight has invalid HTTP status code 400
I know it may be related to How does Access-Control-Allow-Origin header work? but I can't configure the server as I subscribed a shared hosting
(One.com).
I tried to reset my $httpProvider default values in vein.
It seems Twitter API doesn't support CORS headers, and that's why your preflight tests are failing:
https://twittercommunity.com/t/will-twitter-api-support-cors-headers-soon/28276

SSL Post Request to Appengine

I need to develop a web-based service on Google Appengine (Python 2.7) that involves the sending of sensitive data from a third-party website over to my site (preferably through SSL). Say that my url is https://example.appspot.com, and I want the third-party site http://example.com to send two values through a POST request, one is username and the other is password, to https://example.appspot.com/receiverhandler. This receiver handler is class ReceiverHandler(webapp2.RequestHandler). My question is basically: how can I send this POST data through an SSL connection? I'm not entirely familiar with the SSL protocol, so I have no idea where to begin.
Using urlfetch, just send it to the SSL-secured url: https://example.appspot.com/receiverhandler
This gives great explanation of how to do it, using POST params (payload):
https://developers.google.com/appengine/docs/python/urlfetch/

How to send a multipart/mixed HTTP POST request through Runscope?

I want to send a HTTP POST request with Content-Type: Multipart/mixed using Runscope.
Any help/guidance would be great.
There are a couple ways to send data through us, each with varying support for multi-part form data.
Dashboard
When making requests through the dashboard, there is currently no way to add files or other multi-part data to a request. This is something we plan to support in the future, but we don't have a specific timline for implementing it yet.
From your code, via a Runscope URL
When you make a request from code that includes multipart data, it will be relayed through the Runscope URL in tact. The dashboard will display the file meta data that it relayed, but the files are not stored or displayed and retries will not re-send the file data again.
We're happy to help answer any questions in more detail by emailing us at help#runscope.com any time.

Resources