Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
We are trying to upload an app to the qlik server as part of a new import feature requested by one of our clients.
We're trying to use the REST API Upload App as documented here:
After making a post request to the server,
the app (qvf file, converted to a filestream) should be uploaded to the server.
The post request used is:
await _qrsClient.Post("/qrs/app/upload?name=" + fileName + "&xrfkey=(key)", filestring);
where filestring is the streamread-file of the QVF
The Contentheader has been added to the request as following: _client.Headers.Add("Content-Type", "application/vnd.qlik.sense.app");
We might be doing something wrong with providing the body. But we couldn't find any examples so far.
What is the actual result?
Error: The remote server returned an error: (500) Internal Server Error.
Screenshots below show the request and method.
I'm afraid I can't help you with that 500-error, but I have an example that shows how to upload apps using that endpoint. You can find it here:
https://github.com/kolsrud/qlik_rest_sdk/tree/master/Qlik.Sense.RestClient/Examples/AppUpload
Now that I think of it, it could it be that that 500 error comes from the fact that you are using UploadString instead of UploadData which means you are trying uploading a string instead of a byte stream. That's a guess though...
I'm afraid I can't help you with that 500-error, but I have an example that shows how to upload apps using that endpoint. You can find it here:
https://github.com/kolsrud/qlik_rest_sdk/tree/master/Qlik.Sense.RestClient/Examples/AppUpload
Now that I think of it, it could it be that that 500 error comes from the fact that you are using UploadString instead of UploadData which means you are trying uploading a string instead of a byte stream. That's a guess though...
Hi øystein,
Thank you kindly for your response.
The code you provided is very useful, I noticed that my Post method was different.
I was using a string task rather than a byte[] task.
I made a new Post method (PostApp) based off of your example and everything works fine now!
Sincerely,
Joshua