Inserting Embeddable Values
You can right-click in many Value fields throughout the Requests client and see the embeddable values menu. This menu makes inserting complex values, like files or OAuth headers, into your Request much easier. The embeddable values menu provides a utility to create and preview the complex values you can add to your request.
Base64 Encoding
The Base64 Encoding option supports both encoding and decoding values. Note that the Input field supports variables and other embeddable values. To access the menu of embeddable values, you can right-click in this field.
Enter your value in the input field, then select from the options to encode/decode the value. As you select options, you will see a live preview of the output in the Preview field at the bottom of the menu.
Mode
Select whether you want to Encode or Decode the input.
Newlines
Newlines refers to the insertion of line breaks or carriage returns in the Base64-encoded output.
None means that no line breaks or carriage returns are added to the encoded output, resulting in a single long line of text.
64 chars means that a line break is inserted every 64 characters in the encoded output. This is also known as the MIME format, which is commonly used in email attachments.
76 chars means that a line break is inserted every 76 characters in the encoded output. This format was specified in the original Base64 standard and is still used in some contexts today, such as PEM-encoded certificates and keys.
Line Breaks
Line Breaks refer to the type of line ending that is used when inserting line breaks in the Base64-encoded output.
CRLF (\r\n) represents a Carriage Return (CR) followed by a Line Feed (LF)
LF (\n) represents a Line Feed (LF) character
CR (\r) represents a Carriage Return (CR) character
Digest (Hash)
The Digest (Hash) option supports all of the following algorithms: MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 in addition to Base64 or Hexadecimal encoding. If you are using hexadecimal encoding, you can toggle on the Uppercase option to use uppercase characters instead of lowercase characters in the output.
Note that the Input field supports variables and other embeddable values. To access the menu of embeddable values, you can right-click in this field. Enter your value in the input field, then select from the options to encode/decode the value. As you select options, you will see a live preview of the output in the Preview field at the bottom of the menu.
Environment Variable
The Environment Variable option allows you to select an environment variable from the list of all environment variables in your API Project. To create Environment Variables reference Groups and Environments. Note that the environment variables in Requests are not the same logical entities, on the RapidAPI backend, as environment variables in RapidAPI Testing.
File
The File option allows you to upload a file. While you can use this option throughout Requests, it will most likely be used in an HTTP POST request to send a file in Multipart request body.
Form URL-Encoded
The Form URL-Encoded option encodes a key-value pair separated by an equal sign (=). Multiple key-value pairs are separated by an ampersand (&) character. The value and name fields support variables and other embeddable values. To access the menu of embeddable values, you can right-click in either field. As you enter values, you will see a live preview of the output in the Preview field at the bottom of the menu.
HMAC Signature
Hash-based Message Authentication Code (HMAC) Signature is a technique for verifying the integrity and authenticity of a message or data using a secret key and a cryptographic hash function. This option supports all of the following algorithms: MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 in addition to Base64 or Hexadecimal encoding. If you are using hexadecimal encoding, you can toggle on the Uppercase option to use uppercase characters instead of lowercase characters in the output.
The Input and Key fields support variables and other embeddable values. To access the menu of embeddable values, you can right-click in either field. Enter your values in the input and key fields, then select from the options to encode/decode the value. As you select options, you will see a live preview of the output in the Preview field at the bottom of the menu.
HTTP Basic Auth
In HTTP Basic Auth, the client sends an HTTP request with an Authorization header containing the word "Basic" followed by a base64-encoded string of the form "username:password". This option has two fields, Username and Password. Both fields support variables and other embeddable values. To access the menu of embeddable values, you can right-click in either field. When you enter your values, you will see a live preview of the output in the Preview field at the bottom of the menu.
HTTP Token Auth
The HTTP Token Auth option is set to use the "Bearer" scheme by default. In this scheme, "Bearer" is the type of authorization scheme and token is the actual token value. You can change this scheme name under "show more". The Token field supports variables and other embeddable values. To access the menu of embeddable values, you can right-click in the field. When you enter your values, you will see a live preview of the output in the Preview field at the bottom of the menu.
Multipart Body
A Multipart Body is a way to send multiple types of data within a single HTTP request. This option consists of one or more parts, each containing a separate piece of data. Each part is separated by a boundary string that is a unique identifier to mark the beginning and end of each part of the multipart body. The Name and Value fields support variables and other embeddable values. To access the menu of embeddable values, you can right-click in either field. As you enter values, you will see a live preview of the output in the Preview field at the bottom of the menu.
Nonce
Nonce stands for "number used once" and is a cryptographic term that refers to a value that can be used only once in a specific context. The Nonce option allows you to generate a nonce value by entering the desired length and selecting one or more of the following options for the types of values you want to use: Lowercase Letters, Uppercase Letters, Digits, ASCII Symbols, and/or Hexadecimal Digits.
OAuth 1
The OAuth 1 option allows you to configure the following parameters for OAuth 1 authentication: Consumer Key, Consumer Secret, Token, Token Secret, and Signature Method. The supported signature methods are: HMAC-SHA1, HMAC-SHA256, RSA-SHA1, and PLAINTEXT.
Clicking Show More will allow you to add a Nonce, Timestamp, Callback URL, and Additional Params. Furthermore, you can also toggle the option to Add Body has. All fields in the OAuth 1 option support variables and other embeddable values. To access the menu of embeddable values, you can right-click in any field.
OAuth 2
The OAuth 2 option allows you to set one of the following Grant Types for OAuth 2 authentication: Authorization Code, Implicit, Resource Owner Password Credentials, or Client Credentials. The available fields will change based on the grant type you select.
Authorization Code
In the Authorization Code grant type, you can set the following fields: Client ID, Client Secret, Authorization URL, Access Token URL, Callback URL, Scope, Refresh Token, Token Prefix, and Token. Additionally, you can toggle the Set client credentials in the body and Specify the Callback URL in requests options. Note that you will need to use either the RapidAPI Client for Mac or the RapidAPI VSCode Extension to complete the OAuth flow.
Implicit
In the Implicit grant type, you can set the following fields: Client ID, Authorization URL, Callback URL, Scope, Token Prefix, and Token. Additionally, you can toggle the Specify the Callback URL in requests option. Note that you will need to use either the RapidAPI Client for Mac or the RapidAPI VSCode Extension to complete the OAuth flow.
Resource Owner Password Credentials
In the Resource Owner Password Credentials grant type, you can set the following fields: Client ID, Client Secret, Username, Password, Access Token URL, Scope, Refresh Token, Token Prefix, and Token. Additionally, you can toggle the Set client credentials in the body option.
Client Credentials
In the Client Credentials grant type, you can set the following fields: Client ID, Client Secret, Access Token URL, Scope, Token Prefix, and Token. Additionally, you can toggle the Set client credentials in the body option.
Show More
Clicking Show More will allow you to add a State and additional key-value pairs. Furthermore, you can also toggle the option to use Strict Mode. All fields in the OAuth 2 option support variables and other embeddable values. To access the menu of embeddable values, you can right-click in any field.
Request Body Length
The Request Body Length option shows you a dropdown of all the requests in your API Project; selecting a request will pass through the length of characters in that request's body. Note that you cannot select the request you are currently using. The Preview field at the bottom of the menu will display the current value of that request's body length.
Request Body Path
The Request Body Path option shows you a dropdown of all the requests in your API Project; selecting a request and entering a body key name or JSONPath in that request will pass through the value of that key/JSONPath. Note that the key name is case-sensitive. The Path field supports variables and other embeddable values. To access the menu of embeddable values, you can right-click in the field. The Preview field at the bottom of the menu will display the current value of that request's key/JSONPath.
Request Header
The Request Header option shows you a dropdown of all the requests in your API Project; selecting a request and entering a header name in that request will pass through the value of that header. Note that the header value is case-sensitive. The Header field supports variables and other embeddable values. To access the menu of embeddable values, you can right-click in the field. The Preview field at the bottom of the menu will display the current value of that request's header.
Request Method
The Request Method option shows you a dropdown of all the requests in your API Project; selecting a request will pass through the method that request is using. The Preview field at the bottom of the menu will display the current value of that request's method.
Updated 10 months ago