-->
Just sign in and go. Access your favorite Microsoft products and services with just one login. From Office and Windows to Xbox and Skype, one username and password connects you to the files, photos, people, and content you care about most. Learn how Microsoft 365 drives productivity in real world scenarios. Check out the R eal World Solutions & Best Practices videos on the Microsoft Virtual Hub, where you can find success stories and community content from our industry experts, including Microsoft MVPs, R egional Directors, and Strategic Partners. Microsoft allows you to control your account your way with customizable privacy settings. Manage your Xbox, Windows, and other privacy settings on this page. Tip: If you installed the Office apps as part of a suite, such as Office Home and Student or Microsoft 365, search for the suite name.For stand-alone apps search by the app name, such as Project or Visio. In most cases you can't uninstall an individual app if it's included in your Office suite.
By Scott Addie
The HTTP Read-Eval-Print Loop (REPL) is:
- A lightweight, cross-platform command-line tool that's supported everywhere .NET Core is supported.
- Used for making HTTP requests to test ASP.NET Core web APIs (and non-ASP.NET Core web APIs) and view their results.
- Capable of testing web APIs hosted in any environment, including localhost and Azure App Service.
The following HTTP verbs are supported:
To follow along, view or download the sample ASP.NET Core web API (how to download).
Prerequisites
Installation
To install the HttpRepl, run the following command:
A .NET Core Global Tool is installed from the Microsoft.dotnet-httprepl NuGet package.
Usage
After successful installation of the tool, run the following command to start the HttpRepl:
To view the available HttpRepl commands, run one of the following commands:
The following output is displayed:
The HttpRepl offers command completion. Pressing the Tab key iterates through the list of commands that complete the characters or API endpoint that you typed. The following sections outline the available CLI commands.
Connect to the web API
Connect to a web API by running the following command:
is the base URI for the web API. For example:
Alternatively, run the following command at any time while the HttpRepl is running:
For example:
Manually point to the OpenAPI description for the web API
The connect command above will attempt to find the OpenAPI description automatically. If for some reason it's unable to do so, you can specify the URI of the OpenAPI description for the web API by using the --openapi
option:
For example:
Enable verbose output for details on OpenAPI description searching, parsing, and validation
Specifying the --verbose
option with the connect
command will produce more details when the tool searches for the OpenAPI description, parses, and validates it.
For example:
Navigate the web API
View available endpoints
To list the different endpoints (controllers) at the current path of the web API address, run the ls
or dir
command:
The following output format is displayed:
The preceding output indicates that there are two controllers available: Fruits
and People
. Both controllers support parameterless HTTP GET and POST operations.
Navigating into a specific controller reveals more detail. For example, the following command's output shows the Fruits
controller also supports HTTP GET, PUT, and DELETE operations. Each of these operations expects an id
parameter in the route:
Alternatively, run the ui
command to open the web API's Swagger UI page in a browser. For example:
Navigate to an endpoint
To navigate to a different endpoint on the web API, run the cd
command:
The path following the cd
command is case insensitive. The following output format is displayed:
Customize the HttpRepl
The HttpRepl's default colors can be customized. Additionally, a default text editor can be defined. The HttpRepl preferences are persisted across the current session and are honored in future sessions. Once modified, the preferences are stored in the following file:
%HOME%/.httpreplprefs
%HOME%/.httpreplprefs
%USERPROFILE%.httpreplprefs
The .httpreplprefs file is loaded on startup and not monitored for changes at runtime. Manual modifications to the file take effect only after restarting the tool.
View the settings
To view the available settings, run the pref get
command. For example:
The preceding command displays the available key-value pairs:
Set color preferences
Response colorization is currently supported for JSON only. To customize the default HttpRepl tool coloring, locate the key corresponding to the color to be changed. For instructions on how to find the keys, see the View the settings section. For example, change the colors.json
key value from Green
to White
as follows:
Only the allowed colors may be used. Subsequent HTTP requests display output with the new coloring.
When specific color keys aren't set, more generic keys are considered. To demonstrate this fallback behavior, consider the following example:
- If
colors.json.name
doesn't have a value,colors.json.string
is used. - If
colors.json.string
doesn't have a value,colors.json.literal
is used. - If
colors.json.literal
doesn't have a value,colors.json
is used. - If
colors.json
doesn't have a value, the command shell's default text color (AllowedColors.None
) is used.
Set indentation size
Response indentation size customization is currently supported for JSON only. The default size is two spaces. For example:
To change the default size, set the formatting.json.indentSize
key. For example, to always use four spaces:
Subsequent responses honor the setting of four spaces:
Set the default text editor
By default, the HttpRepl has no text editor configured for use. To test web API methods requiring an HTTP request body, a default text editor must be set. The HttpRepl tool launches the configured text editor for the sole purpose of composing the request body. Run the following command to set your preferred text editor as the default:
In the preceding command, is the full path to the text editor's executable file. For example, run the following command to set Visual Studio Code as the default text editor:
To launch the default text editor with specific CLI arguments, set the editor.command.default.arguments
key. For example, assume Visual Studio Code is the default text editor and that you always want the HttpRepl to open Visual Studio Code in a new session with extensions disabled. Run the following command:
Tip Virtual machine applications.
If your default editor is Visual Studio Code, you'll usually want to pass the -w
or --wait
argument to force Visual Studio Code to wait for you to close the file before returning.
Set the OpenAPI Description search paths
By default, the HttpRepl has a set of relative paths that it uses to find the OpenAPI description when executing the connect
command without the --openapi
option. These relative paths are combined with the root and base paths specified in the connect
command. The default relative paths are:
- swagger.json
- swagger/v1/swagger.json
- /swagger.json
- /swagger/v1/swagger.json
- openapi.json
- /openapi.json
To use a different set of search paths in your environment, set the swagger.searchPaths
preference. The value must be a pipe-delimited list of relative paths. For example:
Can i keep you movie line. Instead of replacing the default list altogether, the list can also be modified by adding or removing paths.
To add one or more search paths to the default list, set the swagger.addToSearchPaths
preference. The value must be a pipe-delimited list of relative paths. For example:
To remove one or more search paths from the default list, set the swagger.addToSearchPaths
preference. The value must be a pipe-delimited list of relative paths. For example:
Test HTTP GET requests
Synopsis
Arguments
PARAMETER
The route parameter, if any, expected by the associated controller action method.
Options
The following options are available for the get
command:
-F|--no-formatting
A flag whose presence suppresses HTTP response formatting.
-h|--header
Sets an HTTP request header. The following two value formats are supported:
{header}={value}
{header}:{value}
--response:body
Specifies a file to which the HTTP response body should be written. For example,
--response:body 'C:response.json'
. The file is created if it doesn't exist.--response:headers
Specifies a file to which the HTTP response headers should be written. For example,
--response:headers 'C:response.txt'
. The file is created if it doesn't exist.-s|--streaming
A flag whose presence enables streaming of the HTTP response.
Example
To issue an HTTP GET request:
Run the
get
command on an endpoint that supports it:The preceding command displays the following output format:
Retrieve a specific record by passing a parameter to the
get
command:The preceding command displays the following output format:
Test HTTP POST requests
Synopsis
Arguments
PARAMETER
The route parameter, if any, expected by the associated controller action method.
Options
-F|--no-formatting
A flag whose presence suppresses HTTP response formatting.
-h|--header
Sets an HTTP request header. The following two value formats are supported:
{header}={value}
{header}:{value}
--response:body
Specifies a file to which the HTTP response body should be written. For example,
--response:body 'C:response.json'
. The file is created if it doesn't exist.--response:headers
Specifies a file to which the HTTP response headers should be written. For example,
--response:headers 'C:response.txt'
. The file is created if it doesn't exist.-s|--streaming
A flag whose presence enables streaming of the HTTP response.
Ps3 usb format exfat.
-c|--content
Provides an inline HTTP request body. For example,
-c '{'id':2,'name':'Cherry'}'
.-f|--file
Provides a path to a file containing the HTTP request body. For example,
-f 'C:request.json'
.--no-body
Indicates that no HTTP request body is needed.
Example
To issue an HTTP POST request:
Run the
post
command on an endpoint that supports it:In the preceding command, the
Content-Type
HTTP request header is set to indicate a request body media type of JSON. The default text editor opens a .tmp file with a JSON template representing the HTTP request body. For example:Tip
To set the default text editor, see the Set the default text editor section.
Modify the JSON template to satisfy model validation requirements:
Save the .tmp file, and close the text editor. The following output appears in the command shell:
Test HTTP PUT requests
Synopsis
Arguments
PARAMETER
The route parameter, if any, expected by the associated controller action method.
Options
-F|--no-formatting
A flag whose presence suppresses HTTP response formatting.
-h|--header
Sets an HTTP request header. The following two value formats are supported:
{header}={value}
{header}:{value}
--response:body
Specifies a file to which the HTTP response body should be written. For example,
--response:body 'C:response.json'
. The file is created if it doesn't exist.--response:headers
Specifies a file to which the HTTP response headers should be written. For example,
--response:headers 'C:response.txt'
. The file is created if it doesn't exist.-s|--streaming
A flag whose presence enables streaming of the HTTP response.
-c|--content
Provides an inline HTTP request body. For example,
-c '{'id':2,'name':'Cherry'}'
.-f|--file
Provides a path to a file containing the HTTP request body. For example,
-f 'C:request.json'
.--no-body
Indicates that no HTTP request body is needed.
Example
To issue an HTTP PUT request:
Optional: Run the
get
command to view the data before modifying it:Run the
put
command on an endpoint that supports it:In the preceding command, the
Content-Type
HTTP request header is set to indicate a request body media type of JSON. The default text editor opens a .tmp file with a JSON template representing the HTTP request body. For example:Tip
To set the default text editor, see the Set the default text editor section.
Modify the JSON template to satisfy model validation requirements:
Save the .tmp file, and close the text editor. The following output appears in the command shell:
Optional: Issue a
get
command to see the modifications. For example, if you typed 'Cherry' in the text editor, aget
returns the following output:
Test HTTP DELETE requests
Synopsis
Arguments
PARAMETER
The route parameter, if any, expected by the associated controller action method.
Options
-F|--no-formatting
A flag whose presence suppresses HTTP response formatting.
-h|--header
Sets an HTTP request header. The following two value formats are supported:
{header}={value}
{header}:{value}
--response:body
Specifies a file to which the HTTP response body should be written. For example,
--response:body 'C:response.json'
. The file is created if it doesn't exist.--response:headers
Specifies a file to which the HTTP response headers should be written. For example,
--response:headers 'C:response.txt'
. The file is created if it doesn't exist.-s|--streaming
A flag whose presence enables streaming of the HTTP response.
Example
To issue an HTTP DELETE request:
Optional: Run the
get
command to view the data before modifying it:Run the
delete
command on an endpoint that supports it:The preceding command displays the following output format:
Optional: Issue a
get
command to see the modifications. In this example, aget
returns the following output:
Test HTTP PATCH requests
Synopsis
Arguments
PARAMETER
The route parameter, if any, expected by the associated controller action method.
Options
-F|--no-formatting
A flag whose presence suppresses HTTP response formatting.
-h|--header
Sets an HTTP request header. The following two value formats are supported:
{header}={value}
{header}:{value}
--response:body
Specifies a file to which the HTTP response body should be written. For example,
--response:body 'C:response.json'
. The file is created if it doesn't exist.--response:headers
Specifies a file to which the HTTP response headers should be written. For example,
--response:headers 'C:response.txt'
. The file is created if it doesn't exist.-s|--streaming
A flag whose presence enables streaming of the HTTP response.
-c|--content
Provides an inline HTTP request body. For example,
-c '{'id':2,'name':'Cherry'}'
.-f|--file
Provides a path to a file containing the HTTP request body. For example,
-f 'C:request.json'
.--no-body
Indicates that no HTTP request body is needed.
Test HTTP HEAD requests
Synopsis
Arguments
PARAMETER
The route parameter, if any, expected by the associated controller action method.
Options
-F|--no-formatting
A flag whose presence suppresses HTTP response formatting.
-h|--header
Sets an HTTP request header. The following two value formats are supported:
{header}={value}
{header}:{value}
--response:body
Specifies a file to which the HTTP response body should be written. For example,
--response:body 'C:response.json'
. The file is created if it doesn't exist.--response:headers
Specifies a file to which the HTTP response headers should be written. For example,
--response:headers 'C:response.txt'
. The file is created if it doesn't exist.-s|--streaming
A flag whose presence enables streaming of the HTTP response.
Test HTTP OPTIONS requests
Synopsis
Arguments
PARAMETER
The route parameter, if any, expected by the associated controller action method.
Options
-F|--no-formatting
A flag whose presence suppresses HTTP response formatting.
-h|--header
Sets an HTTP request header. The following two value formats are supported:
{header}={value}
{header}:{value}
--response:body
Specifies a file to which the HTTP response body should be written. For example,
--response:body 'C:response.json'
. The file is created if it doesn't exist.--response:headers
Specifies a file to which the HTTP response headers should be written. For example,
--response:headers 'C:response.txt'
. The file is created if it doesn't exist.-s|--streaming
A flag whose presence enables streaming of the HTTP response.
Set HTTP request headers
To set an HTTP request header, use one of the following approaches:
Set inline with the HTTP request. For example:
With the preceding approach, each distinct HTTP request header requires its own
-h
option.Set before sending the HTTP request. For example:
When setting the header before sending a request, the header remains set for the duration of the command shell session. To clear the header, provide an empty value. For example:
Test secured endpoints
The HttpRepl supports the testing of secured endpoints in the following ways:
- Via the default credentials of the logged in user.
- Through the use of HTTP request headers.
Default credentials
Consider a web API you're testing that's hosted in IIS and secured with Windows authentication. You want the credentials of the user running the tool to flow across to the HTTP endpoints being tested. To pass the default credentials of the logged in user:
Set the
httpClient.useDefaultCredentials
preference totrue
:Exit and restart the tool before sending another request to the web API.
Default proxy credentials
Consider a scenario in which the web API you're testing is behind a proxy secured with Windows authentication. You want the credentials of the user running the tool to flow to the proxy. To pass the default credentials of the logged in user:
Set the
httpClient.proxy.useDefaultCredentials
preference totrue
:Exit and restart the tool before sending another request to the web API.
HTTP request headers
Examples of supported authentication and authorization schemes include:
- basic authentication
- JWT bearer tokens
- digest authentication
For example, you can send a bearer token to an endpoint with the following command:
To access an Azure-hosted endpoint or to use the Azure REST API, you need a bearer token. Use the following steps to obtain a bearer token for your Azure subscription via the Azure CLI. The HttpRepl sets the bearer token in an HTTP request header. A list of Azure App Service Web Apps is retrieved.
Sign in to Azure:
Get your subscription ID with the following command:
Copy your subscription ID and run the following command:
Get your bearer token with the following command:
Connect to the Azure REST API via the HttpRepl:
Set the
Authorization
HTTP request header:Navigate to the subscription:
Get a list of your subscription's Azure App Service Web Apps:
The following response is displayed:
Toggle HTTP request display
Https Aka Ms Help
By default, display of the HTTP request being sent is suppressed. It's possible to change the corresponding setting for the duration of the command shell session.
Enable request display
View the HTTP request being sent by running the echo on
command. For example:
Subsequent HTTP requests in the current session display the request headers. For example:
Disable request display
Suppress display of the HTTP request being sent by running the echo off
command. For example:
Run a script
If you frequently execute the same set of HttpRepl commands, consider storing them in a text file. Commands in the file take the same form as commands executed manually on the command line. The commands can be executed in a batched fashion using the run
command. For example:
Create a text file containing a set of newline-delimited commands. To illustrate, consider a people-script.txt file containing the following commands:
Execute the
run
command, passing in the text file's path. For example:The following output appears:
Clear the output
To remove all output written to the command shell by the HttpRepl tool, run the clear
or cls
command. To illustrate, imagine the command shell contains the following output:
Run the following command to clear the output:
After running the preceding command, the command shell contains only the following output:
Additional resources
The Census Bureau will miss a year-end deadline for handing in numbers used for divvying up congressional seats, a delay that could undermine President Donald Trump's efforts to exclude people in the country illegally from the count if the figures aren't submitted before President-elect Joe Biden takes office.
The Census Bureau plans to deliver a population count of each state in early 2021, as close to the missed deadline as possible, the statistical agency said in a statement late Wednesday.
Https Aka Ms Mssolitairefaq
'As issues that could affect the accuracy of the data are detected, they are corrected,' the statement said. 'The schedule for reporting this data is not static. Projected dates are fluid.'
It will be the first time that the Dec. 31 target date is missed since the deadline was implemented more than four decades ago by Congress.
Internal documents obtained earlier this month by the House Committee on Oversight and Reform show that Census Bureau officials don't expect the apportionment numbers to be ready until days after Biden is inaugurated on Jan. 20.
Once in office, Biden could rescind Trump's presidential memorandum directing the Census Bureau to exclude people in the country illegally from numbers used for divvying up congressional seats among the states. An influential GOP adviser had advocated excluding them from the apportionment process in order to favor Republicans and non-Hispanic whites.
'The delay suggests that the census bureau needs more time to ensure the accuracy of census numbers for all states,' said Terri Ann Lowenthal, a former congressional staffer who specializes in census issues.
By law the Commerce Department must present the president by year's end with population figures from the 2020 census, data then used to determine how many seats in Congress each state gets. The president then is required to submit the numbers to Congress in early January. The Commerce Department oversees the Census Bureau, which conducts the once-a-decade head count of every U.S. resident.
However, there are no penalties for missing the deadline.
'For the Census Bureau, goals No. 1 , 2 and 3 are completeness, accuracy and usefulness. They like to maintain the schedule, but that can't be a priority for them,' said Kenneth Prewitt, a former Census Bureau director during President Bill Clinton's administration.
Besides deciding how many House seats each state gets, the census is used for determining how $1.5 trillion in federal funding is distributed each year.
Trump's July order on apportionment was challenged in more than a half dozen lawsuits around the U.S., but the Supreme Court ruled earlier this month that any challenge was premature, allowing the plan to move forward. The Census Bureau hasn't publicly revealed how it plans to determine who is in the country illegally since the Supreme Court last year prohibited a citizenship question from being added to the census questionnaire.
After the pandemic caused hiring shortages and prompted the Census Bureau to suspend field operations in the spring, the statistical agency asked Congress for extensions. The requests included one that would push the deadline for handing in the apportionment numbers from the end of the year to next spring.
At the time, Trump said, 'This is called an act of God. This is called a situation that has to be. They have to give it.'
Https Aka Ms Ap Results
The request passed the Democratic-controlled House but went nowhere in the Republican-controlled Senate after Trump issued his order.
A coalition of municipalities and advocacy groups sued the Trump administration after it changed the schedule once again to shorten census field operations by a month and return to the Dec. 31 deadline for handing in the apportionment numbers. The plaintiffs argued the count was shortened by the Commerce Department so that census data-crunching happened while Trump was still in office, and they said it would cause minorities to be undercounted.
They also worried that the shortened field operations and data processing would jeopardize the count's accuracy and completeness. Bureau statisticians have been given only half the time originally planned to crunch the numbers, and Census Bureau director Steven Dillingham said last month that agency statisticians had found anomalies in the 2020 data that have popped up in past censuses.
The Census Bureau's watchdog agency on Wednesday said it was concerned about lapses in quality control checks meant to detect falsifications by census takers. The Office of Inspector General said the Census Bureau failed to complete 355,000 re-interviews of households to verify their information was accurate.
Even top Census Bureau officials internally questioned being able to meet the Dec. 31 deadline, with associate director Tim Olson telling colleagues in an email that anyone who thought the census numbers could be crunched by year's end 'has either a mental deficiency or a political motivation.' The email was disclosed in the litigation.
Former Census Bureau director John Thompson said the quality of the data is 'the overarching issue' facing the Census Bureau.
'If these are not addressed, then it is very possible that stakeholders including the Congress may not accept the results for various purposes including apportionment,' said Thompson, who oversaw 2020 census preparation as the agency's leader during the Obama administration.
He said in an email that missing the Dec. 31 target date 'means that the Census Bureau is choosing to remove known errors from the 2020 Census instead of meeting the legal deadline.'
___
Follow Mike Schneider on Twitter at https://twitter.com/MikeSchneiderAP