Post works but not get

Question:
My server is handling post requests perfectly fine but my get requests are not working and giving a 308
Repl link:
Server: https://replit.com/@MTFCommander/Python-Dev-server
Client: https://replit.com/@MTFCommander/ShadowyEdibleBinary

@app.route('/status', methods=['GET'])
def get_status():
    # You can return some status information when a GET request is made
    return jsonify({'status': 'Server is running'}), 200

# Add a route for the root path
@app.route('/', methods=['GET'])
def root():
    return jsonify({'message': 'Welcome to the server!'}), 200

Are you trying to use repl.co? 308 is a permanent redirect.

3 Likes

When i click on new tab it sends me to a replit.dev website: https://c526bb0c-1146-49a6-83c3-504e41084ff5-00-1djsi05jffj0f.replit.dev/

That would be expected, as that’s the new development URL, instead of repl.co

THe client also gives an error of Host not found

What client is saying that the dev url isn’t found?

My bad it is Host not specified:

    raise InvalidURL(e, request=request)
requests.exceptions.InvalidURL: No host specified.

That sounds like you’re not pasting the full URL, what are you providing it?

1 Like