I need to verify the existence of a list of files, and their size, before download them from internet.
Now I am using the "nx_http_client_get_start" but:
I think that NetX HTTP Client is waiting that I call the "nx_http_client_get_packet" to download the file, but it is not my purpose.
Is there another way or is there a correct sequence to reset the HTTP client state?
Thank you very much!
Hello Angler, Once nx_http_client_get_start returns NX_SUCCESS, GET request processing has begun. The correct way of proceeding, in case where you're not interested in fetching the actual file, is to call nx_http_client_get_packet followed by nx_packet_release in a loop, until get_packet returns NX_HTTP_GET_DONE. This will effectively download the file but discard it. Alternatively, you can also use nx_http_client_socket field inside NX_HTTP_CLIENT structure to perform nx_tcp_socket_disconnect followed by nx_tcp_client_socket_unbind. You will also need to set nx_http_client_state to NX_HTTP_CLIENT_STATE_READY so that client can be used for another request. Bear in mind that second solution is technically a hack (otherwise there would be get_stop API provided) and may not work with some servers you're connecting to (i.e. server will deny subsequent requests). Regards
In reply to Renesas Karol: