Everything is working well except with the PUT node. Every time I’m trying to do the request to upload the file, I get an error 400 with an empty body response. But if I do the same request with the exact same parameter using the HTTP Retriever node from Palladian it’s working perfectly.
The thing is that I cannot use the Palladian node in Knime server because there is a license I cannot purchase for only 1 node.
Any idea why the PUT node is not working properly ?
I can provide more information if needed. @szawadski
I used Fiddler to check the difference in the request between the Knime PUT node and the Palladian HTTP Retriever node.
Fiddler act as a proxy between Knime and the internet. I installed fiddler Root certificate to be able to decrypt the HTTPS requests. In the PUT node, I ticked the Trust all certificate to use that certificate.
And what do I see when the requests are going through Fiddler ? Well something unexpected, the PUT node is working properly and I don’ t get the error 400 anymore. When I do the request normally without going through Fiddler, I still get the error 400.
So I still don’ t know why I get that error 400 in the normal case. Does anywone knows why I have such a behavior and how I can fix this ? @szawadski
And what if you trust all certificates without using Fiddler?
When you do not use Fiddler, have you noticed any difference depending on the fact you work behind a proxy or not?
I tried on different machines and different networks and still the same behavior. I haven’t tried a PUT request with something else than Microsoft graph. Do you have any idea of REST API where you can do a PUT request easily ? I will try to find something
We are using https://httpbin.org/ for testing the REST nodes. The PUT node works as expected with this service. The problem usually is that the service requires data to be formatted in a certain way, specific HTTP headers or similar. It’s almost impossible to tell where the problem is without a more detailed error message from the service.
And if I try to mess up with a compulsory request header in the HTTP retriever node I get the same error 400 but with the details in the body.
So yes I guess there is a small difference in the way the data are formatted between the PUT node and the HTTP retriever node. But how can I spot the difference if using Fiddler to observe what is going on is changing the thing I’m observing (see above)?
You can try to change the URL to https://httpbin.org/anything for both the PUT Request node and the Palladian HTTP Retriever node and check whether there are any notable differences in the returned response. The response is basically a copy of the request including headers and data.
So there was minor differences with the headers, some extra ones in the PUT Request node. I added those extra ones in the Palladian HTTP retriever so that the response from https://httpbin.org/anything was exactly the same for both nodes. Then, I put the url back to the microsoft graph API and still the same: request 200 with the Palladian HTTP retriever node and error 400 for the PUT request node. The data is also exactly the same.
So this means the error is not coming from the headers I guess. Any other ideas why it’s not working?
This is the response from https://httpbin.org/anything for the 2 nodes. I removed the base64 string for the binary file under “data” because it’s quite big but they are the same in both case. The file is 1MB as you can see in Content-Length.
Hm, looks very similar. The reason why I was asking for the size is that the PUT Request node uses chunked encoding for larger bodies. This is standard HTTP technology but not all services support it unfortunately. However, I don’t think that chunking already starts at 1MB. Is it possible to send a much smaller request to the Microsoft API?
Just tried with a 15ko file to the Microsoft API and no differences: error 400 with the PUT request node and 200 for Palladian HTTP retriever node. So not coming from the chunked encoding.
Note: all the other types of nodes works normally with the microsoft API (post and get)
My workflow now incorporates reading in a file from SharePoint (using GraphAPI), running it through a workflow, saving to a TempDir then from that TempDir using a Python node to open an Upload Session (using Graph API) and successfully upload back/to SharePoint.