Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
Network Plugin - Add remaining HTTP method types to mock routes (#1962)
Browse files Browse the repository at this point in the history
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: #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: #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
  • Loading branch information
bizzguy authored and facebook-github-bot committed Feb 26, 2021
1 parent 29d16fe commit 4da2b52
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion desktop/plugins/network/MockResponseDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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})
}
Expand Down

0 comments on commit 4da2b52

Please sign in to comment.