@manhng

Welcome to my blog!

WebRequest POST C#

May 11, 2020 20:46

WebRequest POST C# (edit)

HTTP Status Code

https://viblo.asia/p/tim-hieu-ve-http-status-code-lA7GKwx5GKZQ

https://topdev.vn/blog/tim-hieu-ve-http-status-code/

https://kinsta.com/blog/http-status-codes/

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

What does the 404 not found error mean?

https://www.ionos.com/digitalguide/websites/website-creation/what-does-the-404-not-found-error-mean/

How may ways to POST ?

https://medium.com/@rajajawahar77/content-type-x-www-form-urlencoded-form-data-and-json-e17c15926c69

  1. application/ x-www-form-urlencoded
  2. multipart/form-data
  3. application/json

https://docs.microsoft.com/en-us/dotnet/framework/network-programming/how-to-send-data-using-the-webrequest-class

https://docs.microsoft.com/vi-vn/dotnet/framework/network-programming/how-to-request-data-using-the-webrequest-class

How to add parameters into a WebRequest? (HAY)

https://stackoverflow.com/questions/3279888/how-to-add-parameters-into-a-webrequest

How to make an HTTP POST web request

https://stackoverflow.com/questions/4015324/how-to-make-an-http-post-web-request

How can I post data using HttpWebRequest?

https://stackoverflow.com/questions/39246236/how-can-i-post-data-using-httpwebrequest

How to post JSON to a server using C#?

https://stackoverflow.com/questions/9145667/how-to-post-json-to-a-server-using-c

Multipart FormData (Input Type = File)

https://briangrinstead.com/blog/multipart-form-post-in-c/

Others

https://www.c-sharpcorner.com/UploadFile/dacca2/http-request-methods-get-post-put-and-delete/ (Web API)

https://crystalnet-tech.com/RuntimeLibrary/Help/html/scr/How_to__Send_Data_Using_the_WebRequest_Class.html

https://developer.yahoo.com/dotnet/howto-rest_cs.html/

https://stickler.de/informationen/code-snippets/httpwebrequest-mit-post-daten

https://codesamplez.com/programming/http-request-c-sharp

https://pastebin.com/bzWczKXc

https://riptutorial.com/dot-net/example/87/sending-a-post-request-with-a-string-payload-using-system-net-httpwebrequest

SSL/TLS Secure Channel

https://stackoverflow.com/questions/11222759/error-c-sharp-the-underlying-connection-was-closed-could-not-establish-trust-r

https://codeshare.co.uk/blog/how-to-force-a-net-website-to-use-tls-12/

https://stackoverflow.com/questions/47269609/system-net-securityprotocoltype-tls12-definition-not-found

Issues with SSL/TLS

// TRY THIS 1

ServicePointManager
.SecurityProtocol = SecurityProtocolType.Tls12;

// TRY THIS 2
if (ServicePointManager.SecurityProtocol.HasFlag(SecurityProtocolType.Tls12) == false) { ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls12; }

// TRY THIS 3

System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(delegate { return true; });
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12;

Security Protocol (.NET 4.5)

https://stackoverflow.com/questions/28286086/default-securityprotocol-in-net-4-5

https://support.microsoft.com/en-us/help/3154518/support-for-tls-system-default-versions-included-in-the-net-framework

https://support.microsoft.com/en-us/help/3154520/support-for-tls-system-default-versions-included-in-the-net-framework

https://blogs.perficient.com/2016/04/28/tsl-1-2-and-net-support/

Security Protocol (.NET Core)

https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager.securityprotocol?view=netcore-2.1

Configuring HTTPS in ASP.NET Core 2.1

August 27, 2018 13:27

Configuring HTTPS in ASP.NET Core 2.1 (edit)

https://asp.net-hacker.rocks/2018/07/05/aspnetcore-ssl.html

HTTPS + SSL + Certificates + Security + Architecture + Patterns in .NET

April 26, 2018 18:15

HTTPS + SSL + Certificates + Security + Architecture + Patterns in .NET

Certificates in .NET & SSL (HTTPS)

https://dotnetcodr.com/2015/09/18/how-to-enable-ssl-for-a-net-project-in-visual-studio/

https://dotnetcodr.com/2015/05/28/https-and-x509-certificates-in-net-part-1-introduction/

Security & Cryptography

https://dotnetcodr.com/security-and-cryptography/

Architecture & Patterns

https://dotnetcodr.com/architecture-and-patterns/

Certificates

Create Root Certificate
-------------------------------
makecert.exe -r -n "CN=RootCert" -pe -sv "D:\Certificates\RootCert.pvk" -a sha1 -len 2048 -b 01/01/2015 -e 01/01/2030 -cy authority "D:\Certificates\RootCert.cer"
Password: Pass@Word
pvk2pfx.exe -pvk "D:\Certificates\RootCert.pvk" -spc "D:\Certificates\RootCert.cer" -pfx "D:\Certificates\RootCert.pfx"

Create a child certificate to mylocalsite.local:
------------------------------------------------------------
makecert.exe -ic "D:\Certificates\RootCert.cer" -iv "D:\Certificates\RootCert.pvk" -pe -sv "D:\Certificates\mylocalsite.local.pvk" -a sha1 -n "CN=mylocalsite.local" -len 2048 -b 01/01/2015 -e 01/01/2030 -sky exchange "D:\Certificates\mylocalsite.local.cer" -eku 1.3.6.1.5.5.7.3.1
Password: Pass@Word
pvk2pfx.exe -pvk "D:\Certificates\mylocalsite.local.pvk" -spc "D:\Certificates\mylocalsite.local.cer" -pfx "D:\Certificates\mylocalsite.local.pfx"

Create new website mylocalsite.local:
-------------------------------------------------

C:\inetpub\wwwroot\mylocalsite.local


notepad C:\Windows\System32\drivers\etc\hosts

Categories

Recent posts