Does it make sense to have max-age and s-maxage in the Cache-Control HTTP header?

From HTTP Header Field Definitions: 14.9.3 Modifications of the Basic Expiration Mechanism … s-maxage If a response includes an s-maxage directive, then for a shared cache (but not for a private cache), the maximum age specified by this directive overrides the maximum age specified by either the max-age directive or the Expires header. … Note, … Read more

Set Content-Type to application/json in jsp file

You can do via Page directive. For example: <%@ page language=”java” contentType=”application/json; charset=UTF-8″ pageEncoding=”UTF-8″%> contentType=”mimeType [ ;charset=characterSet ]” | “text/html;charset=ISO-8859-1” The MIME type and character encoding the JSP file uses for the response it sends to the client. You can use any MIME type or character set that are valid for the JSP container. The … Read more

Set ‘Content-Type’ header using RestSharp

The solution provided on my blog is not tested beyond version 1.02 of RestSharp. If you submit a comment on my answer with your specific issue with my solution, I can update it. var client = new RestClient(“http://www.example.com/where/else?key=value”); var request = new RestRequest(); request.Method = Method.POST; request.AddHeader(“Accept”, “application/json”); request.Parameters.Clear(); request.AddParameter(“application/json”, strJSONContent, ParameterType.RequestBody); var response = … Read more

How to view the whole raw http request?

In the Chrome DevTools, under the Network section, right-click on the line you are interested in and select the appropriate type of copy from the context menu: An example clipboard content looks like this: Copy as cURL curl ‘https://stackoverflow.com/posts/25291052/editor-heartbeat/answer’ \ -H ‘authority: stackoverflow.com’ \ -H ‘pragma: no-cache’ \ -H ‘cache-control: no-cache’ \ -H ‘sec-ch-ua: “Google … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)