chef 3745 Posted January 22, 2019 Share Posted January 22, 2019 (edited) Maybe a strange question, but MediaBrowser.Common.Net.HttpRequestOptions would like me to add a reference to "System.Memory" in order to fill a POST request with Bytes of data. My concern is that adding references to libraries outside of the MediaBrowser namespace will break .netStandard and its ability to cross platforms. Probably nothing but I wanted to ask. Yep totally confused...again... Here is a code example: public void PostDirectiveResponseAsync(AlexaRequest alexaRequest) { const string uri = "https://api.amazonalexa.com/v1/directives"; var options = new HttpRequestOptions(); options.RequestHeaders["Authorization"] = "Bearer " + alexaRequest.request.token; options.Url = uri; options.RequestContentType = "application/json"; var content = new ByteArrayContent( Encoding.ASCII.GetBytes(_jsonSerializer.SerializeToString(DirectiveResponseBuilder(alexaRequest.request.requestId, "Accessing Home Theater...")))); options.RequestContent = content; //<--THIS IS THE CODE HERE THAT WANTS "SYSTEM.MEMORY" _httpClient.Post(options); } This is the dev environment, if for some reason my question is still wierd: Edited January 22, 2019 by chef Link to comment Share on other sites More sharing options...
Luke 37060 Posted January 22, 2019 Share Posted January 22, 2019 You can go ahead and add the System.Memory package. Link to comment Share on other sites More sharing options...
chef 3745 Posted January 22, 2019 Author Share Posted January 22, 2019 (edited) Thank you. However, there is a chain of references happening here. Now that I have added System Memory, it the environment wants a reference to System.Private.CoreLib. That is fine, but when I go to add the reference, there is an error while adding it. EDIT: Realizing that I would need to add the reference to these libraries the same way I add MediaBrowser through csproj. Edited January 22, 2019 by chef Link to comment Share on other sites More sharing options...
chef 3745 Posted January 22, 2019 Author Share Posted January 22, 2019 (edited) In the end this isn't important after all. Sending directive responses to Amazon Alexa doesn't work because emby's endpoints are so fast there is no compute time to access the API. LOL! The response is instantaneous! Which is really cool! Edited January 22, 2019 by chef Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now