![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java JavaScript Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(JavaScript) Creating an application/json HTTP POST RequestDemonstrates how to create an HTTP POST request having the Content-Type application/json, where the body of the HTTP request is the following JSON:
{
"username" : "my_username",
"password" : "my_password",
"validation-factors" : {
"validationFactors" : [
{
"name" : "remote_address",
"value" : "127.0.0.1"
}
]
}
}
The generated HTTP request looks like this:
POST /something HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: domain
Content-Length: 216
{
"username": "my_username",
"password": "my_password",
"validation-factors": {
"validationFactors": [
{
"name": "remote_address",
"value": "127.0.0.1"
}
]
}
}
Note: This example requires Chilkat v11.1.0 or greater.
|
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.