Parámetro UriTemplate opcional usando WebGet
He intentado estos
y
Parámetros de cadena de consulta opcionales en URITemplate en WCF
Pero nada funciona para mí. Aquí está mi código:
[WebGet(UriTemplate = "RetrieveUserInformation/{hash}/{app}")]
public string RetrieveUserInformation(string hash, string app)
{
}
Funciona si se llenan los parámetros:
https://127.0.0.1/Case/Rest/Qr/RetrieveUserInformation/djJUd9879Hf8df/Apple
Pero no funciona siapp
no tiene valor
https://127.0.0.1/Case/Rest/Qr/RetrieveUserInformation/djJUd9879Hf8df
yo quiero hacerapp
Opcional. ¿Cómo lograr esto?
Aquí está el error cuandoapp
no tiene valor
Endpoint not found. Please see the service help page for constructing valid requests to the service.