GET/POST request form

How can I do a simple form that displays my result in the display area [dictionary format] and POST the form values to some server. Here is my code so far, I don’t know is this is right., I really need some expert help.

import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
app.layout = html.Div([
    
                html.Div([
                    dcc.Input(
                    id='alias', 
                    type='text', 
                    placeholder='Enter your Name',
                    value=''
                    )
                ],style={'padding':5}),
   
                html.Div([
                    dcc.Dropdown(
                    id='colors',
                    options=[{'label': i, 'value': i} for i in Colors],
                    placeholder="Select a Farm",
                    searchable=True,
                    clearable=False
                    
                )
                ],style={'padding':5}),
    
              html.Div([
                    dcc.Input(
                    id='weight', 
                    type='number', 
                    placeholder='Enter your weight',
                    value=''
                    )
                ],style={'padding':5}),
    
            
            html.Div(id='display'),


            html.Button('Display form', id='bt1')
              
    
], style={'padding':50})


@app.callback(Output('display', 'children'),
              [Input('bt1', 'n_clicks')],
              [State('alias', 'value'),
               State('colors', 'value'),
              State('weight', 'value')])

def update_output(n_clicks, input1, input2,input3):
    data = {
        "jobClusterName":"mainCluster",
        "queueName":"precice",
       }
    
    data["Name"] = input1
    data["Visibility"] = input2
    data["Visibility"] = input3
    return html.Div('\n'.join(['{}={}'.format(k,v) for k,v in data.items()]))

    newdata = ('\n'.join(['{}={}'.format(k,v) for k,v in data.items()]))
    url = "http:................"
    headers = {'Content-Type': "text/plain", 'cache-control': "no-cache"}
    return requests.post(url, data=newdata, headers=headers)
    if r.status_code == requests.codes.ok:
        print ("Job Sent Sucessfully")
    else:
        print('failed {}'.format(r.raise_for_status()))
        print(r.status_code)
    
    
    

if __name__ == '__main__':
    app.run_server(debug=True)


Please friends i really need some assistance here

@chriddyp, @Philippe have you had any chance to look at this?

In theory you should encapsulate your inputs in a form tag with a method and action attributes.
But the form will only send the elements having a name attribute. Dash has thought of it for the core.Input but not for the Dropdown, radioItems etc. So you can only send the inputs values.

@stringz Did you success with it?

Any suggestion @Benoit, @chriddyp @Philippe?

I’m struggling with it as well (https://community.plotly.com/t/no-working-form-dash-example-prediction-form-in-a-ml-application/40454)