How do I do a HTTP GET in Java?

If you want to stream any webpage, you can use the method below. import*; import*; public class c { public static String getHTML(String urlToRead) throws Exception { Str... Read More

httpclient - What exactly is an HTTP Entity?

An HTTP entity is the majority of an HTTP request or response, consisting of some of the headers and the body, if present. It seems to be the entire request or response without the request or status... Read More

http - Sending browser cookies during a 302 redirect

According to this blog post: all major browsers, IE (6, 7, 8, 9, 10), FF (17), Safari (6.0.2), Opera (12.11) both on Windows and Mac, set cookies... Read More

api - Different RESTful representations of the same resource

I would suggest the querystring solution (your first). Your arguments against the other alternatives are good arguments (and ones that I've run into in practise when trying to solve the same problem)... Read More

node.js - Proper way to set response status and JSON content in a REST API made with nodejs and express

Express API reference covers this case. See status and send. In short, you just have to call the status method before calling json or send: res.status(500).send({ error: "boo:(" });... Read More

http - PHP CURL DELETE request

I finally solved this myself. If anyone else is having this problem, here is my solution: I created a new method: public function curl_del($path) { $url = $this->__url.$path; $ch = curl_init(... Read More

web services - REST API 404: Bad URI, or Missing Resource?

404 is just the HTTP response code. On top of that, you can provide a response body and/or other headers with a more meaningful error message that developers will see.... Read More

http - Add subdomain to localhost URL

Unfortunately, because localhost is not a proper domain, you can't add a subdomain to it like that. You can , however, trick your computer into thinking it owns a specific domain and test things that... Read More

java - How to get response body using HttpURLConnection, when code other than 2xx is returned?

If the response code isn't 200 or 2xx, use getErrorStream() instead of getInputStream().... Read More

security - Difference between http and https

What are benefits of using HTTPS over HTTP? HTTPS means that you tunnel the HTTP protocol over TLS/SSL which encrypts the HTTP payload. So the benefit is that HTTP requests and responses are tran... Read More