setForcedRequestType (RESOLOVED)

Having a hard time getting this parameter to work

scrapeableFile.setForcedRequestType(ScrapeableFile.RequestType.PUT)

as documented here:

https://support.screen-scraper.com/documentation/api/scrapeablefile/setForcedRequestType

I have initialized a script before the scrapable-file and added that line to the script.

I am trying to send a PUT request but get the following error:

"pdatePrice
Shopify-UpdateProducts: The error message was: class bsh.EvalError (line 1): ScrapeableFile .RequestType .PUT --Sourced file: inline evaluation of: `` scrapeableFile.setForcedRequestType(ScrapeableFile.RequestType.PUT); sessio . . . '' : Class or variable not found: ScrapeableFile.RequestType.PUT"

I am trying to send a post request with Shopify API as documented here:

https://help.shopify.com/api/reference/product_variant#create

Update the title and price of an existing variant

PUT /admin/variants/#{id}.json
{
  "variant": {
    "id": 808950810,
    "option1": "Not Pink",
    "price": "99.00"
  }
}

I have been trying to use the "Request Entity" to modify the header to allow the PUT request.

EDIT: SORRY FOR THE DUPLICATE POSTS. I MUST HAVE DOUBLE CLICKED. COULDN'T FIGURE OUT HOW TO DELETE.

UPDATE: I've resolved the error by adding the line

import com.screenscraper.scraper.ScrapeableFile;

I still haven't been successful with the request.

Here is my latest request

PUT /admin/variants/1267812007941.json HTTP/1.1
Host: (site).myshopify.com
Authorization: Basic key=
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
Referer: https://(key)(site).myshopify.com/admin/products/8965267077/variants.json
Accept-Encoding: gzip
Connection: Keep-Alive
Accept-Language: en-us,en;q=0.5
Content-Length: 29
Content-Type: application/x-www-form-urlencoded

id=1267812007941&price=9999.9

RESPONSE:



{"errors":{"variant":"Required parameter missing or invalid"}}

UPDATE 2:

I've resolved the error by adding:

scrapeableFile.setContentType( "application/json" );