How do I upload swagger-ui to a server on the Internet? - c#

I created the swagger API in C#, was able to put the site on React using the netlife service. Now I want my API to work not only if I run it, but so that it is on a remote server, but I don't know how to do it. Please describe in detail how I can do this (preferably free hosting or with a small fee)

Related

Host .net web api to public access

i have a problem i cant host a my web api to public access. For Example, someone from outside to do some requests and get a response. I tried with IIS configuration, all samples try from the GTS, and then there is no movement. Can anyone post me full specs what i need to do to have for example
https://myipaddress:5001/api/ping
visible on public and someone from another machine can execute this request and get a response
IIS is meant for local development. What you want to do is to publish your application. There are many hosting providers, but if we stick to Microsoft, you can use Azure to publish your application:
https://learn.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?tabs=net60&pivots=development-environment-vs
It is paid, however you can register to get temporary free access to test the solution.

Which server side app should I pick for file transfare scenario

I created some chrome extension that detects a file download event and cancel the download, and gets the download link. Sends the link to myserver.
I want to create a server that recive link to download, download the file, do some manipulation on the file and sends the file back to client.
All the time I developed client side apps (Mainly with c#), and I don't know what to choose for the server side, WCF App or Web API (or something else). the server can be inside the organisation or remote.
What do you think should I pick? any suggestions?
It seems that creating Restful-style services may be more appropriate for this scenario.
You know, both WCF and Asp.net WebAPI can create Restful-style services. WCF could take advantage of the Webhttpbinding to create it.
As for handling file uploads and downloads, I don't think there is any difference between the two techniques. Perhaps the services created by Asp.net WebAPI are a little more mature, such as the ability to deal with form-data stream (multipart/form-data) directly. While WCF service could not directly process the form-data stream.
Here is an example of an upload and download in Asp.net WebAPI.
https://learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/sending-html-form-data-part-2
How to return a file (FileContentResult) in ASP.NET WebAPI
Feel free to let me know if there is anything I can help with.

Access FTP Hosted Web API in C#

I have created a Web API in ASP.NET. I deployed this API in Azure Web App and I was able to use controllers from web API like this http://.azurewebsites.net/api/{controller}.
Now I have deployed the Web API on an FTP server and I am unable to access my controllers like I did before. Any idea on how to do it?
I would really appreciate your help as I am new to FTP.
Thanks in advance.
Just because you can upload/deploy an asp.net site via FTP, it does not mean that the server can automatically run the site and start serving those endpoints (/api/{controller}) automatically.
You need to clarify with whoever is hosting your FTP server if such server can also host asp.net websites. If so, you need to ask them in what particular folder within that server you need to upload your site to.

How to get windows credentials from browser via Angularjs app and using them in the service level?

I have been scratching my head how to solve the issue described below.
So, the company where I work uses Visual Studio Team Services (was Visual Studio Online), and it is integrated/connected to our AD, meaning that If I log in to my workstation I can log in to Team Services without authenticating myself, like SSO.
I'm going to create an application which communicates to Team Services via Team Services SOAP and WebApi clients and here is the problem. I need a user to be able to communicate with Team Services and doing stuff (reading data, creating work items, creating test suits, etc.). I see little chance to convince IT to create a user only for this. They going to reject my request due to security risks.
The application architecture looks this:
browser: angularjs application, spa, calling only the WebApi service
server: WebApi service, which is responsible to communicate with Team Services and transforming data back and forth between the client and Team Services.
database: persisting data for later analysis
There is an idea in my mind, where I can get somehow the windows credentials from the OS and push it down to the server which uses it to communicate with Team Services. In Team Services, we will see that the particular user did things.
The question, how is possible that? The articles I have found searching for something similar, always mention .Net MVC app where I need to modify the web.config in order to get the credentials. But, in my architecture there is no .Net MVC app running on local machines. There is only a SPA running in browsers.
Or my architecture is not fit for this purpose? Shall I rework it and using MVC app to be able to get the credentials and working with them? But, the question still stands, how can I pass the credentials through the calls calling Team Services?
Do you know blog entries dealing with cases like above?
Thanks for any help in advance!
I think you have a bit of confusion over your terms. The SPA (Single Page App) has javascript code delivered by the server to the browser that calls the .NET WebApi code. In order to get the browser to use Kerberos/Windows Authentication you need to add
<system.web>
<authentication mode="Windows" />
</system.web>
to your web.config on the server where the .NET app is running (under IIS).
From here...
http://www.asp.net/web-api/overview/security/integrated-windows-authentication
"On the client side, Integrated Windows authentication works with any browser that supports the Negotiate authentication scheme, which includes most major browsers. For .NET client applications, the HttpClient class supports Windows authentication:"
Then the browser will do the rest for you and the HttpContext.CurrentUser in the .NET code on the server will be set to the windows user of the clients browser.

File Upload to HTTP server from iPhone application. Server side C# API method

Could someone please tell me/link me to how I could create a method similar to those posted below:
http://www.vimeo.com/api/docs/upload
http://www.flickr.com/services/api/upload.api.html
(I am providing the links as I'm not sure how to articulate this question without them!)
I'm using C# ASP.NET. IIS 6.
I have an existing web server with other public API methods. I do not want the iPhone user to have to open a web browser, and post to an aspx page. I want the iPhone developer to be able to call my method, and have one of the parameters be a handle to the file which gets POSTed.
Thanks in advance for any help.
You'll need to create a WCF Service Application. You can use this as a webservice that can be exposed to your clients. You can create a RESTful service using WCF where clients can POST video's to.
When searching for 'REST, API, WCF' you'll probably find all the resources you are looking for.

Categories