Network Plugin - Add remaining HTTP method types to mock routes (#1962)

Summary:
Currently, mock routes can only be created for GET and POST HTTP method types.  Mocks should support all the valid HTTP method types.

See specification for a list of valid types:

    https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

This was requested in issue: https://github.com/facebook/flipper/issues/1960

Here is a screen shot showing the new values added to the select list:

![image](https://user-images.githubusercontent.com/337874/108955120-418b7400-7633-11eb-9248-63d9639e0c4f.png)

## Changelog

Network Plugin - support all valid HTTP method types in mock routes

Pull Request resolved: https://github.com/facebook/flipper/pull/1962

Test Plan:
Define mock routes using additional method types
Using "Flipper Messages" plugin, verify that new types have been sent to device

Reviewed By: passy

Differential Revision: D26635050

Pulled By: mweststrate

fbshipit-source-id: 6d85ac346bd18687516a3566d1048982ec7cae46
This commit is contained in:
bizzguy
2021-02-26 07:19:56 -08:00
committed by Facebook GitHub Bot
parent 29d16feed5
commit 4da2b52803

View File

@@ -245,7 +245,17 @@ export function MockResponseDetails({id, route, isDuplicated}: Props) {
<StyledSelect
grow={true}
selected={requestMethod}
options={{GET: 'GET', POST: 'POST'}}
options={{
GET: 'GET',
POST: 'POST',
PATCH: 'PATCH',
HEAD: 'HEAD',
PUT: 'PUT',
DELETE: 'DELETE',
TRACE: 'TRACE',
OPTIONS: 'OPTIONS',
CONNECT: 'CONNECT',
}}
onChange={(text: string) =>
networkRouteManager.modifyRoute(id, {requestMethod: text})
}