application/x-www-form-urlencoded or multipart/form-data?

TL;DR Summary; if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded. The MIME types you mention are the two Content-Type headers for HTTP POST requests that user-agents (browsers) must support. The purpose of both of those types of requests is to send a list of name/value … Read more

Problem HTTP error 403 in Python 3 Web Scraping

This is probably because of mod_security or some similar server security feature which blocks known spider/bot user agents (urllib uses something like python urllib/3.3.0, it’s easily detected). Try setting a known browser user agent with: This works for me. By the way, in your code you are missing the () after .read in the urlopen … Read more

Do I need Content-Type: application/octet-stream for file download?

No. The content-type should be whatever it is known to be, if you know it. application/octet-stream is defined as “arbitrary binary data” in RFC 2046, and there’s a definite overlap here of it being appropriate for entities whose sole intended purpose is to be saved to disk, and from that point on be outside of … Read more

Use of PUT vs PATCH methods in REST API real life scenarios

NOTE: When I first spent time reading about REST, idempotence was a confusing concept to try to get right. I still didn’t get it quite right in my original answer, as further comments (and Jason Hoetger’s answer) have shown. For a while, I have resisted updating this answer extensively, to avoid effectively plagiarizing Jason, but … Read more

Chrome hangs after certain amount of data transfered – waiting for available socket

Looks like you are hitting the limit on connections per server. I see you are loading a lot of static files and my advice is to separate them on subdomains and serve them directly with Nginx for example. Create a subdomain called img.yoursite.com and load all your images from there. Create a subdomain called scripts.yourdomain.com … Read more

What is the difference between POST and GET? [duplicate]

GET and POST are two different types of HTTP requests. According to Wikipedia: GET requests a representation of the specified resource. Note that GET should not be used for operations that cause side-effects, such as using it for taking actions in web applications. One reason for this is that GET may be used arbitrarily by robots or crawlers, which should … Read more

HTTP Status 504

I’m getting the following error when my win32 (c#) app is calling web services. I understand ‘I think’ that this is because the upstream request does not get a response in a timely fashion. But my question is this? How do I change the app.config settings in my win32 application to allow more time to … Read more