#How to run this server #Use the datetime classes to create, extractt and munipulate dates and times.
from datetime import datetime
#Use json to format your response
import json
#import the requests library to be able to SEND request
import requests
#From the flask library, import only the Flask, request ad Response classes.
#the request class (not the same as the requests library) is used to to used to recieve requests
#if you have to convert several objects as one nested json structure, you cannot use flask,jsonify.
app = Flask(__name__)
CORS(app)
@app.route("/", method = ["POST"]) # Run this method when receiving any POST request
@cross_origin(origin='*') #Allow requests from any domain
def myMainFunction():
...
from datetime import datetime
import json
import requests
from flask import Flask, request , Response
app = Flask(__name__)
CORS(app)
@app.route("/", method = ["POST"]) # Run this method when receiving any POST request
@cross_origin(origin='*') #Allow requests from any domain
def myMainFunction():
datetime_object = datetime.now()
print(datetime_object)
print('Type :- ',type(datetime_object))
Comments
Leave a comment