Giter Club home page Giter Club logo

flask_api_endpoints's Introduction

Project Documentation: Flask Server

Introduction

Welcome to the documentation for my project, which includes a Flask sever and a parser (extra: test client). This documentation will guide you through the installation and usage of the project components.

Installation

To get started with the project, follow these installation steps:

  1. Clone the repository:
git clone https://github.com/cutecei/flask_api_endpoints.git
  1. Navigate to the project directory:
cd flask_api_endpoints
  1. Install the project dependencies:
pip install -r requirements.txt
  1. Run MongoDB server Make sure you have created facct collection

  2. Run server

python flask_server.py

Usage

This project has method: POST and GET

  1. POST:

    Allows the client to add data to MongoDB. Also there is a parser that checks the data to see if it matches the required format and if the fields are not empty.

   def send_json(json_file):
    with open(json_file, "r") as file:
        send_data = json.load(file)
        response = requests.post(url_post, json=send_data)
        print(response.text)
  1. GET:

    Allows the client to retrieve data from MongoDB. Also client can add params for advanced search.

def get_data():
    params = {
        "malwareList": ["Lockbit"]
    }
    response = requests.get(url_get, params=params)
    print(response.json())

or

def get_data():
    params = {
        "dateFirstSeen": "2023-09-30T11:03:52+00:00",
        "dateLastSeen": "2023-09-30T11:03:52+00:00"
    }
    response = requests.get(url_get, params=params)
    print(response.json())

flask_api_endpoints's People

Contributors

0xf3rn avatar

Watchers

 avatar

Forkers

serfodi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.