Is there a matlab network package called matlab.net​.http.fiel​d.SessionS​tate?

3 visualizzazioni (ultimi 30 giorni)
Hi, I am using https://github.com/jebej/MatlabWebSocket to connect a sensor server ,
AI google studio give me some codes, one is :
import matlab.net.http.field.SessionState;
which is a core netwrok service, it told me. but the matlab can not find it,
so the AI let me run:
exist(fullfile(matlabroot, 'toolbox', 'matlab', 'network', '+matlab', '+net', '+http'), 'dir')
and the answer is 0, so the AI told me that some core package related network is missing.
But I reinstalled the matlab, still can not find the package.
Is AI correct or AI hallucinations?

Risposte (1)

Abhipsa
Abhipsa il 19 Giu 2025
Hello @jun,
It seems like the AI agent has provided some inaccurate information regarding the existence of "matlab.net.http.field.SessionState" class.
The command you used needs some modifications as shown below, as "matlab.net.http.field" package is a part of the MATLAB's Web Services interface :
>> exist(fullfile(matlabroot, 'toolbox', 'matlab', 'external', 'interfaces', 'webservices', 'http', '+matlab', '+net', '+http', '+field'), 'dir')
To verify the list of officially supported HTTP header field classes, you can refer to the MATLAB documentation here:
This page lists all available classes in the "matlab.net.http.field" package. As you’ll see, there is no "SessionState" field included.
I hope this resolves your query.

Prodotti


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by