Resultats de text complet:
- nodejs_express
- st app = express() const port = 3000 app.get('/', getHello) async function getHello (req, ... eccions URL amb ''express'' cal afegir entrades '.get' com en aquest exemple: <code javascript> co... t app = express() const port = 3000 app.get('/clients', getClients) async function getCli... res.send(`Llista de clients`) } app.get('/login', getLogin) async function getLogin (
- django_api
- lar: * **Mètodes** equivalents al CRUD de BD: **GET, POST, PUT, DELETE** (però poden definir-se més).... sonResponse from polls.models import * #... def get_questions(request): jsonData = list( Question... que implementis un //endpoint//, per exemple a ''/get_questions'' dins de ''urls.py'': <file python ur... ', views.index, name='index'), #... path('get_questions', api.get_questions, name='get_question
- fastapi
- from fastapi import FastAPI app = FastAPI() @app.get("/api/index") def index(): return {"message":... = Representation State Transfer (REST) API * GET * POST * DELETE * PUT * PATCH Tots aq... sponibles amb el decordaro @app. Per exemple @app.get() =====Swagger OpenAPI===== Al arrancar el se... irectament de la URL: <file python main.py> @app.get("/student/{id}") async def student_info(id:UUID):
- futurs_java
- try { Integer result = future.get(); System.out.println("Resultat: " + ... n ja està llest, afagem la dada resultant amb “**.get()**” ==== Futurs, aturar un futur amb .cancel() ... } else { Integer result = future.get(); System.out.println("Resultat: ... f0=%s, f1=%s, f2=%s, f3=%s", f0.get(), f1.get(), f2.get(), f3.get() );
- patrons_disseny
- ublic Poligon() {} public Poligon(Poligon target) { if (target != null) { this.x = target.x; this.y = target.y; this.color = target.color; } } public a
- python_web
- o again!' #...mes codi... </file> ==== Mètodes [GET,POST,+] ==== A més, cal tenir en compte que cada ... emple típic és el d'un formulari en 2 parts: * GET: és el mètode per defecte, i sol mostrar un formu... si no especifiquem res al decorator, és el mètode GET @app.route('/formulari') def formulari_get(): # mostrem el formulari return """ <form method='
- django_test
- er personalitzat #from django.contrib.auth import get_user_model #User = get_user_model() class LoginTests(TestCase): def test_create_superuser(self): ... de control /admin response = self.client.get('/admin/') # comprovem que el login és co... de control /admin response = self.client.get('/admin/') # comprovem que el login és co
- django_lliga
- ['object_id'] partit = Partit.objects.get(id=partit_id) jugadors_local = [fitxa... : local_res.append(str(partit.get().gols_local())+"-"+str(partit.get().gols_visitant())) else: local_res.app... is_valid(): lliga = form.cleaned_data.get("lliga") # cridem a /classificacio/<l
- php
- el·les adjacents). </WRAP> \\ ===== Formularis, GET, POST i PHP ===== Referències bàsiques a W3Schoo... en PHP]] * Per comprovar si certes variables $_GET o $_POST ens arriben, es sol emprar la [[https://... rg/wiki/index.php/PHP_Forms|Creació de formularis GET]]. Fes la pràctica de la fórmula de resolució de ... es.cat/fites_daw_mp07_uf1#fita_2us_formularis_amb_get_i_post|fites sobre formularis de la UF1 de MP07 d
- django_docker
- python:3.11.7-bullseye # install db libs RUN apt-get update RUN apt-get install -y default-mysql-client libmariadb-dev RUN apt-get install -y libmariadb-dev-compat gcc gdal-bin lib... python:3.11.7-bullseye # install db libs RUN apt-get update RUN apt-get install -y default-mysql-clien
- django_frontend
- ) </file> \\ ===== Filtrat amb paràmetres GET ===== En moltes aplicacions haurem de recuperar paràmetres GET de la //request//. En aquest podem restringir les... llista(request): items = None if request.GET.get("qid"): items = Option.objects.filter( question__id=request.GET["qid"] ) else:
- puppet @ceti_mp03
- e i que serà compatible amb Ubuntu 22.04 <code> wget https://apt.puppetlabs.com/puppet-release-bullsey... alitzem les llistes de paquets de apt <code> apt-get update </code> #instal·lem puppetserver, l’agent servidor del puppet <code> apt-get install puppetserver </code> #Per defecte, Pup... deb que serà compatible amb Ubuntu 20.04 <code>wget https://apt.puppetlabs.com/puppet-release-focal.d
- iot_django_aproximacio_un_dashboard_sobre_raspberry_pi
- code python> from django.shortcuts import render, get_object_or_404 from django.http import HttpRespons... s.order_by("location_desc") template = loader.get_template("temperature/index.html") context = ... ions generals de la gràfica. sensor = get_object_or_404(TemperatureSensor, pk=sensor_id) ... !/usr/bin/env python from django.core.wsgi import get_wsgi_application import os # Establim l'arxiu se
- daw_mp06_reactpy
- def handle_click(event): id = event['target']['value'] # obtenim llista de choices choices_API = requests.get('http://localhost:8002/api/get_choices/'+id) resultat = choices_API.json() items_choices= ... ent def HelloWorld(): response_API = requests.get('http://localhost:8002/api/get_questions') re
- django_ninja
- ): try: user = Usuari.objects.get(auth_token=token) return user ... amb BasicAuth # amb o sense "trailing slash" @api.get("/token", auth=BasicAuth()) @api.get("/token/", auth=BasicAuth()) def obtenir_token(request): retu... titol: str editorial: Optional[str] @api.get("/llibres/", response=List[LlibreOut], auth=AuthB