post

Sending POST requests – Response 400

Sending POST requests – Response 400 Question: so i’m trying to scrape questions from Quora, from the link https://www.quora.com/search?q=microwave&type=question Since the questions are dynamically loaded at first I used selenium to simulate scroll down but it is really slow so I’m trying differently. When scrolling down Quora sends a POST request to another link with …

Total answers: 1

sort feed by engagement count django

sort feed by engagement count django Question: I would like to sort my feed containing image posts by the engagement (number_of_dislikes + number_of_likes), so that the most popular post is on top. But I’m pretty unsure of how to do it. Please have a look at what I have so far and help me out. …

Total answers: 2

How to fix error "raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 8 (char 7)"

How to fix error "raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 8 (char 7)" Question: I’m trying to read data from json file by following code but i get error, any idea how to fix that? file= open("C:\Users\User\Desktop\Post.json",’r’) json_in=file.read() request_json=json.loads(json_in) print(request_json) Json file "name": "Test", "job": "Programer" Asked By: Moshe || …

Total answers: 1

Django 4 REST framework JSON POST request filter

Django 4 REST framework JSON POST request filter Question: I have this API where I need to filter some data. My user will pass a JSON containing several instances that I need to return to them if there existis or not on my database. But I don’t know how I can make Django 4 make …

Total answers: 1

Send JSON from curl by POST to Python FastAPI

Send JSON from curl by POST to Python FastAPI Question: I’m running the following script: from fastapi import FastAPI from fastapi import Request import os import uvicorn app = FastAPI() @app.post("/") async def root(data: Request): try: res = await data.json() except Exception as ex: res = str(ex) return res if __name__ == "__main__": prog = …

Total answers: 1

Django rest framework create or update in POST resquest

Django rest framework create or update in POST resquest Question: can anyone help please, with DRF according to POST request, I want to create(if not exists) or update() table belows are my codes model.py class User1(models.Model): user = models.CharField(max_length=10) full_name = models.CharField(max_length=20) logon_data = models.DateTimeField(blank=True, null=True) serializer.py class UserSerializer(serializers.ModelSerializer): class Meta: model = User1 fields …

Total answers: 2

Problems on post method with form and tuple data

Problems on post method with form and tuple data Question: I’m trying to make a post request to this url: url I’m trying this code to get this request: from requests import get, post data = { ‘entrada’: { ‘site’: ‘site’, ‘origen’: ‘origen’, ‘tipo’: ‘turismo’, ‘fecha’: 2022, ‘marca’: -1, ‘marcanombre’: ”, ‘modelo’: -1, ‘modelonombre’: ”, …

Total answers: 1

Django POST request is empty

Django POST request is empty Question: Running Django 4.1.1. Having this code below in template. By clicking a button it sends a data to delete apropriate marker. <form method="POST"> {% csrf_token %} <ol> {% for marker in markers %} <li> {{ marker }} – <button class="button btn-primary" id="delete" value="{{ marker.pk }}" type="submit">Delete</button> </li> {% endfor …

Total answers: 1

I can't send my POST method to the API with Barer Token

I can't send my POST method to the API with Barer Token Question: I’m new to API Rest and I’m currently trying to POST to Azure Health Data Services using Python with Databricks. To do this I need to get the token which I get through Postman without problems (in Postman my POST does work). …

Total answers: 1