is there any way to retrieve the content type of chatMessageHostedContent?
Via graphClient.Chats["id"].Messages["id"].HostedContents["id"].Content.Request().GetAsync() I get the stream, but I don't know what kind of file it is.
If I send the request manually via the GraphServiceClient's HttpProvider, then I get the content type but have to handle decoding...
Is there a better/simpler solution here?
Related
Is it possible to transfer a picture from the back to the front as a Upload file? How to transfer file from back to front?
What I did to transfer the image from front to back:
Adding a new data type for a file:
Next, you will need to define scalar Upload in the sсhema.graphqls file:
The most important thing is not to forget to write the method in Mutations in the sсhema.graphqls file:
Look, I get javax.servlet.http.Part when I upload a photo. At the front we get the data through the Apollo hook useQuery/useMutation
But how do I send the photo back to the front?
After all, javax.servlet.http.Part is not transferred to the front?
How to write a method signature in the sсhema.graphqls file in Query section and in the implementation of this method in GraphQLMutationResolver implemented class?
I need to transfer the file. If the GraphQl team sees this message, please write more documentation on this topic.
So I'm quite new to IIB and Extended SQL but what I want to do should be straight forward. I have a REST application which has a resource that is attached to a subflow. What I want to do is to get the input value passed to the service and use it to call a remote web service using the HTTP request node as shown below
SET OutputLocalEnvironment.Destination.HTTP.RequestLine.Method = 'POST';
SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://localhost:8002/MyService';
SET OutputLocalEnvironment.Destination.HTTP.QueryString.RemoteParam= InputLocalEnvironment.REST.Input.Parameters.myValue;
What is happening is, when I call the REST method and pass the value as a GET, I'm able to access the value. However, when I pass the parameter value using POST, I'm unable to access the value. My current flow is as follows:
Input > Compute > HTTPRequest > Compute > Output
I have searched on Google and applied all recommendations (e.g. setting compute node to LocalEnvironment) but nothing seems to work.
Well, we need more information in order to solve your problem but I guess you have problem in your HTTP request node
Go to HTTP request then in properties go to HTTP setting and change HTTP method to the method that you are using ( get or post )
and if you want to see if you are fetching data from right property just lunch debugger and put breakepoint in before and after of your nodes, then you can see what data you are receiving in each level and you can call the proper property.
ps. don't forget to deploy your project again in order to see new
changes
I hope that works for you
After further research, I found that IIB does not automatically parse content submitted as application/x-www-form-urlencoded. I inserted a trace node and realised that the parameters are instead submitted as a BLOB. All I had to do was read the blob, cast it to a string then use a Split function or a message model to get the individual parameters. Thanks for the pointers
I am using URLSession 'uploadTask from file'
func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask
Almost everything works fine, but now our server needs an extra param as 'uploadKey' to be passed as content disposition along with fileName.
This can be done by generating multipart request with content disposition added as we normally do.
I want to add it while using 'uploadTask from file' to avoid memory pressure. Please suggest how to do it.
From reading the question, I suspect that you're subtly misunderstanding what upload tasks do (and unfortunately, Apple's documentation needs some serious improvement in this area, which doesn't help matters). These tasks don't upload a file in the same way that a web browser would if you chose a file in an upload form. Rather, they use the file as the body of an upload request. I think they default to providing a sane Content-Type based on the filename, though I'm not certain, but they do not send data in form encoding.
So assuming I'm fully understanding the question, your options are either:
Keep using multipart encoding. Optionally write the multipart body into a file rather than keeping it in memory, and use the upload task to provide the body from that file instead of from an NSData object.
Upload the file you're trying to send, unencoded, as the entirety of the upload body, and provide whatever additional parameters you need to provide in the form of GET parameters in the URL itself.
Use some other encoding like JSON or protocol buffers.
Either way, the server code will determine which of these approaches is supported. If you can modify the server code, then I would recommend the second approach. It is slightly more efficient than the first approach, much more efficient than JSON, and easier to implement than any of the other approaches.
I am trying to send data to my jsp via:"xhr.send(projectCode);"
but apparently the parameter is not received when I am trying to realise it with System.out.print it is a null displayed.
so the story from the begining. my javascript function send the parameter to the jsp whitch construct an xml file and resend to the first one.
this will reconstruct my second dropdownList with the xml code constructed and received.
so the problem that the parameter dosent sent at all.
What should I do.
Just note in case the syntax whatever you have sent is like this:
url="postjob2.jsp?param=" + param;
After param=" keep a space and then the parameter. My issue got resolved as soon as I entered the space.
The simplest all-round solution is to run your application with a HTTP-tracer, such as fiddler for windows or wireshark. In that way you can see if the proper data is being submitted from your client to the server Given the amount of details you provide, I think this is the best starting point
I am a newbie and i want to get a process or a key window as an object as i need to send message to it.In fact , i need to get them so that i can manipulate them with my input method kid(IMKit).
The corresponding method is:
-(BOOL)inputText:key:modifiers:client:
I want the key window/process receive the event as client.
I am appreciated if anyone can help.
i want to get a process or a key window as an object as i need to send message to it. … the corresponding method is
-(BOOL)inputText:key:modifiers:client:
You have it the wrong way around. As noted in the documentation, that method is one that you implement, in your input method. Your input method does not send that message; it receives it. And all you do in that method is accept or veto the input.
I think you need to post a higher-level question about whatever it is you're trying to do, asking how to do it.