QueryParam binding with enum in jersey

From the Javadoc, the @QueryParam annotated type must either: Be a primitive type Have a constructor that accepts a single String argument Have a static method named valueOf or fromString that accepts a single String argument (see, for example, Integer.valueOf(String)) Be List<T>, Set<T> or SortedSet<T>, where T satisfies 2 or 3 above. The resulting collection … Read more

How to show query parameter options in Django REST Framework – Swagger

New swagger from rest_framework.filters import BaseFilterBackend import coreapi class SimpleFilterBackend(BaseFilterBackend): def get_schema_fields(self, view): return [coreapi.Field( name=”query”, location=’query’, required=False, type=”string” )] class MyViewSet(viewsets.ViewSet): filter_backends = (SimpleFilterBackend,) def list(self, request, *args, **kwargs): # print(request.GET.get(‘query’)) # Use the query param in your view return Response({‘hello’: ‘world’}, status.HTTP_200_OK)

Servlet vs REST

You are confusing two paradigms here: REST is a software architecture “style”; Servlet is a server-side technology. You can, for example, implement REST-like services using Servlets.

FileUpload with JAX-RS

On Server Side you can use something like this @POST @Path(“/fileupload”) //Your Path or URL to call this service @Consumes(MediaType.MULTIPART_FORM_DATA) public Response uploadFile( @DefaultValue(“true”) @FormDataParam(“enabled”) boolean enabled, @FormDataParam(“file”) InputStream uploadedInputStream, @FormDataParam(“file”) FormDataContentDisposition fileDetail) { //Your local disk path where you want to store the file String uploadedFileLocation = “D://uploadedFiles/” + fileDetail.getFileName(); System.out.println(uploadedFileLocation); // save it … Read more

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