Redmine REST API -client-server [closed] - html

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.

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.

Best practice when building both RESTful API and web application [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 2 years ago.
Improve this question
So i'm developing a project using Laravel 5.7, and I want to include a RESTful API to make the mobile version communicate with the app, and of course the web application itself.
My question is, what is the best practice is such cases when it comes to routing and controllers, I have read some suggestions here and other blogs and got confused, some suggested that I should declare One Routing file to be used by the web app and API and add an identifier for e.g("web" and "mobile") and based on it I return a view or JSON data, others suggested to separate the routing (api and web) but point them to the same controller methods which is think it's better than the first suggestion.
Appreciate your help.
Laravel separates the api routes from the web routes.
Web routes are in the routes/web.php file.
API routes are in the routes/api.php file.
What can be annoying is to separate the logic of the API part from the logic of the web part.
Here the solution is still simple. What I do is I create a folder that I call API in app/Http/Controllers; all the controllers I put in this folder are in the App\Http\Controllers\API namespace. In the corresponding route file, all you need to do is add the API\ flag before the controller name.

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.

HTML Hide input/post name [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Im looking to hide a post request name from the user, So they cannot post to a URL.
For example, Im looking for something that will avoid users checking the post request name and sending something to bypass the restrictions to insert into a database.
If the POST request comes from the user's browser, then they can inspect it. There is no way to avoid that.
Your only option is to make the POST request from somewhere else (such as your server). There is a good chance that you won't be able to do that (due to dependencies on the request coming from the user or included data they supply).
You mention "restrictions". If those restrictions are currently enforced with client side code: Enforce them with server side code.

FileMaker + Ruby + HTML + eBay: Any way to upload listings as HTML? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I work for a small business that does a lot of commerce via eBay. Right now, we have a pretty large database (in FileMaker), and our current method for getting newly-entered items from the database to eBay involves entering them manually, line-by-line, through a browser window into Auctiva. This is an extremely time-consuming process, and I've been tasked with automating it, if possible I've already written a good bit of code in Ruby to parse tab-delimited FileMaker exports into pretty much whatever I want, so I was wondering if there was some way to upload static HTML directly into an eBay listing. If so, I could just snag a spiffy HTML template from oswd, modify it, and modify the code I've already written to handle injecting the pertinent info directly into the document, then just upload that.
If you can do whatever with the product data, and have all the data necessary to make a listing, you can use the eBay API.
http://developer.ebay.com/products/trading/
has a HTTP POST based submission handler so you can use any http client you want (Net::HTTP, HTTP party, Curb etc) and post your listings that way.