Is JSONP obsolete? [closed] - json

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
With various methods to get around the same-origin policy, such as CORS (if you have access to the server hosting the files), or by using parsing methods such as the getJSON method in jQuery, does JSONP ever now need to be used?
(I actually struggled for a long time to get my head round JSONP anyway - I don't think it helped that some sites seemed to overlook it - for example, the Google Map developer docs state that they return data as JSON, but make no mention of the Same Origin Policy - is this naïve of them for assuming most people know of the issues and can get round of it, or naïve of me for getting too bogged down with trying to understand the technical differences between JSON and JSONP?)

Yes, JSONP is obsolete now. There's absolutely no reason to offer a JSONP service anymore. Ajax with the relevant CORS headers is saner and cleaner.

Related

Can I use POST instead of PUT in a NodeJS app? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 25 days ago.
The community reviewed whether to reopen this question 25 days ago and left it closed:
Original close reason(s) were not resolved
Improve this question
What is the difference if I always use POST method to update a row in the MySQL or Cassandra database instead of PUT?
I ask this because when I did research on that I read in some other questions that were saying POST request causes multiple instances creation. I wanted to make sure if is that correct?
The database doesn't care about how the server talks to clients.
Technically you could use POST for everything. That's basically how GraphQL works. But doing that means your API is not RESTful.
These are the basic RESTful API methods:
Method
Description
GET
Retrieve information about the REST API resource
POST
Create a REST API resource
PUT
Update a REST API resource
DELETE
Delete a REST API resource or related component
That being said, if you feel like your use-case works and reads better with just POST or GET, go for it.
Neither mysql nor Cassandra will even be aware if the client made a http put or post request, so from a database point of view it is totally irrelevant which http request type you use.

Having HTML markup as part JSON response, is it a best practice? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Is it a good practice to have html markup as part of API response? which has the content-type as application/json
Sample json response
{
html : '<div id="markup">This is the server response html.</div>',
data : {property : 'This is the data received from the server.'}
}
It's not best practice.
Generally, you want to create a separation of concerns within your systems. By having your API return HTML, your server starts to take some responsibility for the presentation layer of your application as well as providing the data.
Think about what would happen if in future, you want to build a mobile app using your server. It wouldn't be able to effectively make use of the html property. Would you add a separate property that gets used by the mobile app? You don't want to keep changing your API server each time a new client wants to use it.
Think about what happens if you get a designer on to help you with your application. They now need the ability to modify code on the API server as well as the web layer. If you keep presentation of the data separate to the raw data, you won't run into this problem.

Does browserify still have a purpose after es6 [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Does browserify, webpack, and other still have a purpose now than we have the module import with es6?
Beside of the coffee/typescript conversion, I mean.
Does browserify still have a purpose after es6
Of course it still has purpose.
Browserify/webpack resolves requires/imports and packages your code into a bundled file (or files). ES6 (ES2015) doesn't do anything to change that need.
Until the browser gets a native support for resolving require or import, many people will still want to package their code. Even then, bundling is still useful because you can package your code into a single http request instead of one http request per import.
Maybe after all browsers support http2 and native import, then you can start ditching the bundlers ^_^

Redmine REST API -client-server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
My boss told me to create a REST API using html/css but i'm copletely blocked..
How can we create Redmine RESTful API using html ?
You can't create a REST API only with html. A REST API means that you defines a "resource" and you utilize the HTTP (usually) protocol in order to change the "state" of the resource. For example: the resource is http://example.com/a. You can make a GET request in order to get this resource, POST for changing it and DELETE for deleting it.
As you can see, it's a work with the server and not with the content that the client sees (html) - You need a server-side language, like: Python, Java, Php, etc.
Please tell us if you know a server-side language and we will be able to tell you how you can program a REST API in that language.

Piwik Web Analytics - Anyone with experience of it? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm considering trying to get more granular analytics for my sites than the free plan on my current provider, Clicky, provides.
Piwik looks like a strong contender in the analytics space (and I'm surprised I haven't heard about it before) but I want to be sure I'm not throwing the baby out with the bathwater by swapping to it.
Does anyone have any experience with this software and - in particular - are there any people out there who've tried customising the code or developing their own plugin?
To add to ghommey's response: we're also using Piwik right now and it fits the bill for our purposes. Separating IP ranges isn't really a concern for us as we use separate development and deployment servers.
As for customizing it, I've written a couple of Piwik plugins, one of which served to enable SSO for our (non-PHP) project. Writing the code itself has been relatively straightforward; however their authentication cookies violate the HTTP cookie RFCs (RFC2109 and RFC2068) in that they use illegal characters so there might be also other dragons in places.
AS of the latest release (q1 2010) filtering IPs is possible.